본문 바로가기

Docker/Docker (에러해결)

groovy.lang.MissingPropertyException: No such property: docker for class: groovy.lang.Binding

# 에러를 해결하자

에러내용은 아래와 같다.

groovy.lang.MissingPropertyException: No such property: docker for class: groovy.lang.Binding
    at groovy.lang.Binding.getVariable(Binding.java:63)
    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:224)
    at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:241)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:238)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:221)
    at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:28)
    at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)

# 해결방법은 역시 인터넷 > 구글링

https://itecnote.com/tecnote/docker-jenkins-docker-pipeline-error/

 

Docker – Jenkins docker pipeline error – iTecNote

I'm trying to follow this tutorial to create a simple docker environment in as part of my jenkins pipeline build. I'm trying to build a couple of docker images just as a test before I do my maven build. At the moment I have the following groovy for my Jenk

itecnote.com

- 아주 간단했다...

Jenkins 라이브러리를 설치를 안했데...

Best Solution

The issue was I needed to install the Docker Pipeline plugin in Jenkins.

# 설치 후 후기

- 또다른 에러 발생

Got permission denied while trying to connect to the Docker daemon socket 
at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/build?buildargs=: dial unix /var/run/docker.sock: connect: permission denied

- 해결방법 찾기

https://github.com/occidere/TIL/issues/116

 

docker 설치 후 /var/run/docker.sock의 permission denied 발생하는 경우 · Issue #116 · occidere/TIL

docker 설치 후 /var/run/docker.sock의 permission denied 발생하는 경우 상황 docker 설치 후 usermod로 사용자를 docker 그룹에 추가까지 완료 후 터미널 재접속까지 했으나 permission denied 발생 (설치 참고: https://b

github.com

해결

/var/run/docker.sock 파일의 권한을 666으로 변경하여 그룹 내 다른 사용자도 접근 가능하게 변경

sudo chmod 666 /var/run/docker.sock

또는 chown 으로 group ownership 변경

sudo chown root:docker /var/run/docker.sock

- 끝 -