Docker build files for entrypoint and UIDs

This commit is contained in:
Christian Poessinger 2019-01-11 09:15:33 +01:00
parent ecc0db23c3
commit 4004496e89
3 changed files with 3 additions and 3 deletions

1
Jenkinsfile vendored
View File

@ -21,6 +21,7 @@ pipeline {
dockerfile { dockerfile {
filename 'Dockerfile' filename 'Dockerfile'
label 'jessie-amd64' label 'jessie-amd64'
dir 'docker'
args '--privileged --sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=1006 -e GOSU_GID=1006' args '--privileged --sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=1006 -e GOSU_GID=1006'
} }
} }

View File

@ -160,5 +160,5 @@ RUN export LATEST="$(curl -s https://checkpoint-api.hashicorp.com/v1/check/packe
RUN sed "s/^%sudo.*/%sudo\tALL=(ALL) NOPASSWD:ALL/g" -i /etc/sudoers && \ RUN sed "s/^%sudo.*/%sudo\tALL=(ALL) NOPASSWD:ALL/g" -i /etc/sudoers && \
chmod a+s /usr/sbin/useradd /usr/sbin/gosu /usr/sbin/usermod chmod a+s /usr/sbin/useradd /usr/sbin/gosu /usr/sbin/usermod
COPY scripts/docker-entrypoint.sh /usr/local/bin/ COPY entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT ["docker-entrypoint.sh"] ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

View File

@ -18,7 +18,6 @@ fi
# Notify user about selected UID/GID # Notify user about selected UID/GID
echo "Current UID/GID: $NEW_UID/$NEW_GID" echo "Current UID/GID: $NEW_UID/$NEW_GID"
# Create user called "docker" with selected UID
useradd --shell /bin/bash -u $NEW_UID -g $NEW_GID -o -m $USER_NAME useradd --shell /bin/bash -u $NEW_UID -g $NEW_GID -o -m $USER_NAME
usermod -aG sudo $USER_NAME usermod -aG sudo $USER_NAME
sudo chown $NEW_UID:$NEW_GID /home/$USER_NAME sudo chown $NEW_UID:$NEW_GID /home/$USER_NAME