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

Jenkins 에서 Cannot run program "docker": error=2, No such file or directory 에러가 발생하는 경우 #165

Open
occidere opened this issue Oct 25, 2021 · 0 comments

Comments

@occidere
Copy link
Owner

Jenkins 에서 Cannot run program "docker": error=2, No such file or directory 에러가 발생하는 경우

상황

  • Local macOS 에 설치된 Jenkins 에서 docker pipeline 을 사용하면 Cannot run program "docker": error=2, No such file or directory 가 발생

원인

  • Jenkins 에 로컬 macOS 의 docker 가 등록된 PATH 를 등록하지 않았기 때문
    • macOS 에서만 간간히 발생하는 듯 함

해결

  • Jenkins 가 설치된 경로 에서 homebrew.mxcl.jenkins-lts.plist 파일을 찾음
    • ex) /usr/local/opt/jenkins-lts/homebrew.mxcl.jenkins-lts.plist
  • 파일 열어서 아래의 내용 추가
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>homebrew.mxcl.jenkins-lts</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/local/opt/openjdk@11/bin/java</string>
		<string>-Dmail.smtp.starttls.enable=true</string>
		<string>-jar</string>
		<string>/usr/local/opt/jenkins-lts/libexec/jenkins.war</string>
		<string>--httpListenAddress=127.0.0.1</string>
		<string>--httpPort=8080</string>
	</array>
	<key>RunAtLoad</key>
	<true/>

	<!-- ... 중략 ... -->

	<!-- 여기 아래 내용 추가 -->
	<key>EnvironmentVariables</key>
	<dict>
	<key>PATH</key>
		<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
	</dict>
	<!-- 여기까지 -->
</dict>
</plist>

참고

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

1 participant