-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (22 loc) · 1.38 KB
/
Dockerfile
File metadata and controls
33 lines (22 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM debian:13.1
ENV bashunit_dir='/typeddevs'
ENV bashunit_version='0.23.0'
ENV bashunit_hash='7043c1818016f330ee12671a233f89906f0d373f3b2aa231a8c40123be5a222b'
# bashunit installation dependencies
RUN apt-get update; apt-get install -y curl perl git docker.io sudo; rm -rf /var/lib/apt/lists/*
RUN mkdir -p $bashunit_dir
RUN curl -o /tmp/install.sh https://bashunit.typeddevs.com/install.sh
RUN bash /tmp/install.sh $bashunit_dir $bashunit_version; ln -s $bashunit_dir/bashunit /usr/bin/bashunit; chmod +x $bashunit_dir/bashunit
# verify the sha256sum for bashunit 0.14.0
RUN DIR="$bashunit_dir"; KNOWN_HASH="$bashunit_hash"; FILE="$DIR/bashunit"; [ "$(shasum -a 256 "$FILE" | awk '{ print $1 }')" = "$KNOWN_HASH" ] && echo -e "✓ \033[1mbashunit\033[0m verified." || { echo -e "✗ \033[1mbashunit\033[0m corrupt"; rm "$FILE"; } ; bashunit --version;
RUN groupadd -g 1000 dev && useradd -m -u 1000 -g dev dev && \
echo "dev ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/dev && chmod 0440 /etc/sudoers.d/dev
WORKDIR /home/dev/shell-dev-tools
RUN --mount=type=bind,source=bashrc,target=/tmp/bashrc \
cat /tmp/bashrc >> /root/.bashrc && \
cat /tmp/bashrc >> /home/dev/.bashrc
USER dev
RUN git config --global init.defaultBranch master && \
git config --global user.email "shell@dev.tools" && \
git config --global user.name "dev"
ENTRYPOINT ["/home/dev/shell-dev-tools/docker-entrypoint.sh"]