Skip to content

Commit

Permalink
improved dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ferama committed Feb 7, 2023
1 parent 5a09e07 commit 7f31dd6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
26 changes: 23 additions & 3 deletions hack/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,29 @@ RUN go build \

# Final docker image
FROM ubuntu:latest
RUN apt update && \
apt install -y ca-certificates && \
RUN set -eux; \
apt update && \
apt install -y \
ca-certificates \
sudo \
git \
vim \
byobu \
psmisc \
iputils-ping \
netcat \
dnsutils \
bash-completion \
&& \
apt clean

RUN \
sed -i 's/^#force_color_prompt=yes/force_color_prompt=yes/' /etc/skel/.bashrc \
&& adduser --gecos "" --disabled-password rospo \
&& echo "rospo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \
&& addgroup rospo sudo

COPY --from=gobuilder /rospo /usr/local/bin/rospo
ENTRYPOINT ["rospo"]

COPY ./hack/docker/entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
4 changes: 4 additions & 0 deletions hack/docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#! /bin/sh

cd /home/rospo
sudo -u rospo rospo "$@"

0 comments on commit 7f31dd6

Please sign in to comment.