-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (29 loc) · 913 Bytes
/
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
FROM debian:bullseye-slim
MAINTAINER rocco <[email protected]>
ENV PROJECT hacca
ENV USER hacca
ENV SHELL h7sh
# Install software
COPY $PROJECT /usr/local/$PROJECT
# Install the software
RUN set -ex && \
apt-get update && \
apt-get install -qq \
libcrypt1 \
libevent-2.1-7 \
sudo \
less && \
rm -rf /var/lib/apt/lists/*
# 1. Add valid login shell
# 2. Create user and group
# 3. Change ownership
# 4. Add user to sudoers
RUN \
add-shell /usr/local/$PROJECT/bin/$SHELL && \
useradd --no-create-home --user-group --home-dir /usr/local/$PROJECT --shell /usr/local/$PROJECT/bin/$SHELL --comment 'HL7 user' $USER && \
chown -R $USER:$USER /usr/local/$PROJECT && \
echo "$USER ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER $USER
WORKDIR /usr/local/$PROJECT
# Go for fun
CMD ["/usr/local/hacca/bin/h7sh"]