mirror of
https://github.com/willfarrell/docker-crontab.git
synced 2025-04-04 14:05:11 +02:00
fix: clean up logic and only apply group if needed
This commit is contained in:
parent
b89e312569
commit
02a89f6dac
@ -3,8 +3,7 @@ FROM library/docker:stable
|
||||
ENV HOME_DIR=/opt/crontab
|
||||
RUN apk add --no-cache --virtual .run-deps bash jq \
|
||||
&& mkdir -p ${HOME_DIR}/jobs ${HOME_DIR}/projects \
|
||||
&& adduser -S docker -D \
|
||||
&& sed -i "s/999/99/" /etc/group
|
||||
&& adduser -S docker -D
|
||||
|
||||
COPY docker-entrypoint /
|
||||
ENTRYPOINT ["/docker-entrypoint"]
|
||||
|
@ -25,8 +25,12 @@ mkdir -p ${HOME_DIR}/jobs ${HOME_DIR}/projects
|
||||
# Create docker group using correct gid from host, and add docker user to it
|
||||
if ! grep -q "^docker:" /etc/group; then
|
||||
DOCKER_GID=$(stat -c '%g' ${DOCKER_SOCK})
|
||||
addgroup -g ${DOCKER_GID} docker
|
||||
adduser docker docker
|
||||
if [ "${DOCKER_GID}" != "0" ]; then
|
||||
addgroup -g ${DOCKER_GID} docker
|
||||
adduser docker docker
|
||||
else
|
||||
adduser docker root
|
||||
fi
|
||||
fi
|
||||
|
||||
slugify() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user