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

Fail to start jenkins with no permission in entrypoint? #973

Closed
NewbMiao opened this issue May 25, 2017 · 5 comments
Closed

Fail to start jenkins with no permission in entrypoint? #973

NewbMiao opened this issue May 25, 2017 · 5 comments

Comments

@NewbMiao
Copy link

NewbMiao commented May 25, 2017

Info:

  • Docker version ($ docker --version): Docker version 17.03.1-ce, build c6d412e
  • Laradock commit ($ git rev-parse HEAD): 81053c0
  • System info (Mac, PC, Linux): Mac
  • System info disto/version: Darwin newbmiaodeMacBook-Pro.local 16.4.0 Darwin Kernel Version 16.4.0: Thu Dec 22 22:53:21 PST 2016; root:xnu-3789.41.3~3/RELEASE_X86_64 x86_64

Issue:

RT
When start jenkins use docker-compose start jenkins it failed
and i get log using docker-compose logs jenkins

$ docker-compose logs jenkins
Attaching to laradock_jenkins_1
jenkins_1             | [FATAL tini (6)] exec /usr/local/bin/jenkins.sh failed: Permission denied

obviously, it caused by no permission
so i simply change dockerfile like this:

# use root to set permission and group of jenkins.sh
USER root
COPY jenkins-support /usr/local/bin/jenkins-support
COPY jenkins.sh /usr/local/bin/jenkins.sh
RUN chown -R ${user} /usr/local/bin/jenkins.sh && chmod +x /usr/local/bin/jenkins.sh
USER ${user}
ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/jenkins.sh"]

now it seems ok.

and there is some line comfused me:

# Add jenkins to the correct group
# see http://stackoverflow.com/questions/42164653/docker-in-docker-permissions-error
# use "getent group docker | awk -F: '{printf "%d\n", $3}'" command on host to find correct value for gid or simply use 'id'
ARG DOCKER_GID=998

does this GID right for every environment?

UPDATE:
For mac, there is no docker group default, and i finally use below solution.
use sudo to run docker in host

Or
add daemon group for jenkins

docker for mac is use daemon group for docker
use echo $(ls -al /var/run/docker.sock | awk '{print $4}')

@NewbMiao
Copy link
Author

NewbMiao commented May 26, 2017

@NewbMiao
Copy link
Author

Try to use docker outside jenkins-docker with -v \var\run\docker.sock: \var\run\docker.sock
Cause docker in docker share volume is totaly bad idea!
It cost me half day to figure it out!
see do-not-use-docker-in-docker-for-ci

@mouyong
Copy link
Contributor

mouyong commented Dec 30, 2017

jenkinsci/docker#493

It solve my problem.

cd laradock && chown -R 1000:1000 jenkins/jenkins_home

@stale
Copy link

stale bot commented Feb 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Feb 2, 2020
@stale
Copy link

stale bot commented Feb 23, 2020

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants