Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot start container "addgroup: gid '999' in use" #13

Closed
lbngoc opened this issue Feb 26, 2018 · 2 comments
Closed

Cannot start container "addgroup: gid '999' in use" #13

lbngoc opened this issue Feb 26, 2018 · 2 comments

Comments

@lbngoc
Copy link

lbngoc commented Feb 26, 2018

After cloning this repo, edit config.json and run docker-compose up, I got this error

 docker-compose up   
Creating network "dockercrontab_default" with the default driver
Building crontab
Step 1/7 : FROM library/docker:stable
stable: Pulling from library/docker
ff3a5c916c92: Already exists
1a649ea86bca: Already exists
ce35f4d5f86a: Already exists
b6206661264b: Already exists
b8b71dba24d3: Already exists
3873004a68ee: Already exists
Digest: sha256:e9f04ffabbb1be195f25271116a52b2b560483abd4dc2ad54d6a90046fd1f397
Status: Downloaded newer image for docker:stable
 ---> 26c47276c586
Step 2/7 : ENV HOME_DIR=/opt/crontab
 ---> Running in b387e8e27cad
Removing intermediate container b387e8e27cad
 ---> 440cf51a26ba
Step 3/7 : RUN apk add --no-cache --virtual .run-deps bash jq     && mkdir -p ${HOME_DIR}/jobs ${HOME_DIR}/projects     && adduser -S docker -D
 ---> Running in 6c3c5bc01fab
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
(1/9) Installing pkgconf (1.3.10-r0)
(2/9) Installing ncurses-terminfo-base (6.0_p20171125-r0)
(3/9) Installing ncurses-terminfo (6.0_p20171125-r0)
(4/9) Installing ncurses-libs (6.0_p20171125-r0)
(5/9) Installing readline (7.0.003-r0)
(6/9) Installing bash (4.4.19-r1)
Executing bash-4.4.19-r1.post-install
(7/9) Installing oniguruma (6.6.1-r0)
(8/9) Installing jq (1.5-r4)
(9/9) Installing .run-deps (0)
Executing busybox-1.27.2-r7.trigger
OK: 15 MiB in 21 packages
Removing intermediate container 6c3c5bc01fab
 ---> b0faa62c08fc
Step 4/7 : COPY docker-entrypoint /
 ---> 9e1135a8f39e
Step 5/7 : ENTRYPOINT ["/docker-entrypoint"]
 ---> Running in ac8f89693299
Removing intermediate container ac8f89693299
 ---> 0e33a177185c
Step 6/7 : HEALTHCHECK --interval=5s --timeout=3s     CMD ps aux | grep '[c]rond' || exit 1
 ---> Running in 723d815aca58
Removing intermediate container 723d815aca58
 ---> 45ffdf0c69f4
Step 7/7 : CMD ["crond","-f"]
 ---> Running in ac500595a0b8
Removing intermediate container ac500595a0b8
 ---> 781ff2511daa
Successfully built 781ff2511daa
Successfully tagged dockercrontab_crontab:latest
WARNING: Image for service crontab was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating dockercrontab_crontab_1 ... done
Attaching to dockercrontab_crontab_1
crontab_1  | addgroup: gid '999' in use
dockercrontab_crontab_1 exited with code 1

Please help me

@ealebed
Copy link

ealebed commented Feb 26, 2018

Hi! I had the same error, solved by editing Dockerfile (add one string, sed -i "s/999/99/" /etc/group) to this:

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

COPY docker-entrypoint /
ENTRYPOINT ["/docker-entrypoint"]

HEALTHCHECK --interval=5s --timeout=3s \
    CMD ps aux | grep '[c]rond' || exit 1

CMD ["crond","-f"]

@lbngoc
Copy link
Author

lbngoc commented Feb 28, 2018

Thanks @ealebed, it's working now!

@lbngoc lbngoc closed this as completed Feb 28, 2018
willfarrell added a commit that referenced this issue Feb 28, 2018
Change group id to not conflict with host common id

Fix #13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants