-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
47 lines (37 loc) · 1.58 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
# >>> runtime snippet >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# this is a Dockerfile snippet used in docker containers for runtime
ARG SIMVERSE_HOST_UID
ARG SIMVERSE_HOST_GID
RUN apk add --no-cache --update \
libzmq \
libevent \
db \
db-c++ \
libressl \
jq \
tini \
tree \
sqlite-libs
# TODO: move this into a special snippet to provide go debugging support
# RUN go get -u github.com/go-delve/delve/cmd/dlv
# RUN dlv version
# we want to prepare simnet user and run services under it
# our main reason is to have docker _volumes written with host-friendly permissions
# see https://dille.name/blog/2018/07/16/handling-file-permissions-when-writing-to-volumes-from-docker-containers/
# if the GID is already taken, create group without forcing external SIMVERSE_HOST_GID
RUN if getent group $SIMVERSE_HOST_GID > /dev/null 2>&1; \
then addgroup simnet; \
else addgroup -g $SIMVERSE_HOST_GID simnet; \
fi
# if the GID is already taken, create group without forcing external SIMVERSE_HOST_GID
RUN if id -u $SIMVERSE_HOST_UID > /dev/null 2>&1; \
then adduser -D -h /home/simnet -G simnet simnet; \
else adduser -D -h /home/simnet -G simnet -u $SIMVERSE_HOST_UID simnet; \
fi
WORKDIR /home/simnet
ENV PATH $PATH:/home/simnet
# we don't want to force entrypoint to not confuse ad-hoc commands via `docker exec`
# see our `run` scripts in individual containers which might decide to use tiny as a wrapper
# ENTRYPOINT ["/sbin/tini", "--"]
# see https://github.com/krallin/tini
# <<< runtime snippet <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<