简体   繁体   中英

docker: command not found

I am running Jenkins on Openshfit using Catalog, however, after creating my pipeline, I am getting Docker build failed

  • docker build -t biloocabba/kncare:2. /var/lib/jenkins/jobs/KnCare-prod/workspace@tmp/durable-8e36408e/script.sh: line 1: docker: command not found
  • I was trying to access the Pod as root and install docker from there but not possible. scc showing restricted mode.

  • Any idea how to Edite the yml file to get the pod to run with root privileges

First, you should not run pod as root user because it can compromise whole openshift cluster security. Its not best practice to run as root user.

I would suggest using docker build config or jenkins pipeline strategy to build images in oenshift jenkins.

Still if you want to run your pod as root user, then follow the below steps:

  1. create a service account in your namespace

  2. add the service account to "anyuid" scc

  3. then run your pod with this service account.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM