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

View File

@ -100,12 +100,12 @@ jobs:
command: logout command: logout
- bash: | - 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-builder"
docker volume prune --force --filter "label=image=ripe-atlas" 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 docker start watchtower || true
displayName: "Clean up" displayName: "Clean up"