allow changing of UID/GID during docker build (#6)

This commit is contained in:
James Swineson 2020-07-31 07:04:21 -07:00
parent 0707df1063
commit 6ac4f71fdf
2 changed files with 8 additions and 5 deletions

View File

@ -20,7 +20,12 @@ ARG DEBIAN_FRONTEND=noninteractive
COPY --from=builder /root/atlasswprobe-*.deb /tmp
ARG ATLAS_UID=101
ARG ATLAS_GID=999
RUN ln -s /bin/true /bin/systemctl \
&& adduser --system --uid $ATLAS_UID atlas \
&& groupadd --force --system --gid $ATLAS_GID atlas \
&& usermod -aG atlas atlas \
&& apt-get update -y \
&& apt-get install -y libcap2-bin iproute2 openssh-client procps net-tools gosu \
&& dpkg -i /tmp/atlasswprobe-*.deb \
@ -31,8 +36,6 @@ RUN ln -s /bin/true /bin/systemctl \
COPY entrypoint.sh /usr/local/bin
RUN chmod +x /usr/local/bin/* \
&& groupadd -fr atlas \
&& usermod -aG atlas atlas \
&& chown -R atlas:atlas /var/atlas-probe \
&& mkdir -p /var/atlasdata \
&& chown -R atlas:atlas /var/atlasdata \

View File

@ -100,12 +100,12 @@ jobs:
command: logout
- bash: |
docker system prune --all --force --filter "label=image=ripe-atlas-builder"
docker system prune --all --force --filter "label=image=ripe-atlas"
docker volume prune --force --filter "label=image=ripe-atlas-builder"
docker volume prune --force --filter "label=image=ripe-atlas"
docker system prune --all --force --filter "label=image=ripe-atlas-builder"
docker system prune --all --force --filter "label=image=ripe-atlas"
docker start watchtower || true
displayName: "Clean up"