-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (37 loc) · 1.13 KB
/
Dockerfile
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM alpine:latest
ENV LC_ALL=en_US.UTF-8
# install dependencies and change default shell from ash to bash
RUN \
--mount=type=cache,target=/var/cache/apk \
apk add \
--update \
bash \
git \
tar \
coreutils \
python3 \
&& apk add \
--repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \
git-filter-repo \
&& sed -i -e "s/bin\/ash/bin\/bash/" /etc/passwd \
&& echo "" > /root/.ash_history
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
WORKDIR /etc/skel/
RUN echo -e "\nsource ~/scripts/config/.profile\n" >> .profile
WORKDIR /etc/skel/scripts/
COPY config.sh .
COPY config ./config
# ENV ENV="/home/you/.profile"
# RUN echo ". $HOME/.profile" > /etc/profile
# Copy all shell scripts, dereference links to get full files
RUN --mount=type=bind,source=.,target=/context cp -LR /context/shell ./shell
# Old way to copy shell scripts does not work with symlinks
# COPY shell ./shell
# add user and group, copy skel to root too
RUN addgroup -g 1000 you && \
adduser -G you -u 1000 you -D && \
adduser -G you -u 1001 gha -D && \
cp -r /etc/skel/. ~
# USER 1000:1000
WORKDIR /run