forked from OneIdentity/safeguard-bash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (39 loc) · 1.33 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
FROM alpine
ARG COMMIT_ID
ARG BUILD_VERSION
LABEL maintainer="[email protected]" \
org.label-schema.schema-version="1.0" \
org.label-schema.name="oneidentity/safeguard-bash" \
org.label-schema.description="Safeguard Bash scripting environment" \
org.label-schema.url="https://github.com/OneIdentity/safeguard-bash" \
org.label-schema.vcs-url="https://github.com/OneIdentity/safeguard-bash" \
org.label-schema.vcs-ref=$COMMIT_ID \
org.label-schema.vendor="One Identity LLC" \
org.label-schema.version=$BUILD_VERSION \
org.label-schema.docker.cmd="docker run -it oneidentity/safeguard-bash"
RUN apk -U --no-cache add \
shadow \
vim \
curl \
jq \
grep \
sed \
coreutils \
util-linux \
bash \
openssl \
openssh \
&& rm /usr/bin/vi \
&& ln -s /usr/bin/vim /usr/bin/vi \
&& groupadd -r safeguard \
&& useradd -r -g safeguard -s /bin/bash safeguard \
&& mkdir -p /home/safeguard \
&& chown -R safeguard:safeguard /home/safeguard
COPY src/ /scripts/
COPY samples/ /samples/
COPY test/ /test/
COPY .bashrc /home/safeguard/
USER safeguard
WORKDIR /home/safeguard
ENTRYPOINT ["/bin/bash"]
CMD ["-c","exec /bin/bash --rcfile <(echo '. /home/safeguard/.bashrc; /scripts/connect-safeguard.sh')"]