diff --git a/Dockerfile b/Dockerfile index 001357a..fe23d0f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ diff --git a/azure-pipelines.yaml b/azure-pipelines.yaml index e53d552..257c360 100644 --- a/azure-pipelines.yaml +++ b/azure-pipelines.yaml @@ -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"