forked from oneconcern/datamon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sidecar.Dockerfile
40 lines (31 loc) · 1.03 KB
/
sidecar.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
FROM datamon-binaries as base
# dist-alike during development/debug
RUN cp /stage/usr/bin/datamon /usr/bin/datamon
ADD ./hack/fuse-demo/datamon.yaml /root/.datamon/datamon.yaml
# Build the dist image
FROM ubuntu:18.10
RUN apt-get update && apt-get install -y --no-install-recommends \
fuse \
sudo \
vim \
zsh \
&&\
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN echo "allow_root" >> /etc/fuse.conf
COPY --from=base /stage /
ENV ZONEINFO /zoneinfo.zip
ADD ./hack/fuse-demo/datamon.yaml /root/.datamon/datamon.yaml
ADD hack/fuse-demo/wrap_datamon.sh .
ADD hack/fuse-demo/wrap_application.sh .
# USER root
RUN chmod a+x wrap_datamon.sh
# USER developer
RUN useradd -u 1020 -ms /bin/bash developer
RUN groupadd -g 2000 developers
RUN usermod -g developers developer
RUN chown -R developer:developers /usr/bin/datamon
RUN mkdir -p /etc/sudoers.d &&\
echo "developer ALL = (ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer &&\
chmod 0400 /etc/sudoers.d/developer
USER developer
ENTRYPOINT [ "datamon" ]