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

Image build failed in Openshift #379

Closed
fsc12 opened this issue Oct 2, 2018 · 4 comments
Closed

Image build failed in Openshift #379

fsc12 opened this issue Oct 2, 2018 · 4 comments

Comments

@fsc12
Copy link

fsc12 commented Oct 2, 2018

Actual behavior
Trying to build images in Openshift results in an error:

....
INFO[0004] Extracting layer 0
DEBU[0005] creating dir /
error building image: error building stage: chmod /: operation not permitted

Expected behavior
The build successfully executes.

To Reproduce
Steps to reproduce the behavior:

  1. Create a secret in Openshift
    oc create secret generic kaniko-secret --from-file=kaniko-secret.json

  2. Create a ConfigMap which contains the Dockerfile
    oc create configmap config-docker --from-file=Dockerfile

  3. Create a ConfigMap which contains x.509-certificates
    oc create configmap ca-certificates --from-file=cert.crt

4.) Create the Pod
oc create -f pod.yaml

pod.yaml

5.) Dockerfile

Dockerfile

The error occurred for all base-Images I've testet (RHEL7, Debian9, Centos7).

@fsc12 fsc12 changed the title Image build fail Image build failed in Openshift Oct 2, 2018
@xanonid
Copy link
Contributor

xanonid commented Oct 12, 2018

Probably, the issue is that in OpenShift per-default only non-root containers are allowed. See #105 .

@priyawadhwa
Copy link
Collaborator

Seems like there is some documention around running you container as root in OpenShift (which would be required to build that Dockerfile with kaniko)

@bobcatfish
Copy link
Contributor

Going to assume those docs resolved the issue, plz reopen if not @fsc12 !

@unresolv
Copy link

unresolv commented Oct 3, 2019

I have made an openshift-compatible version of the executor image here which seems to work for me (OKD 3.11): https://github.com/ContainerSolutions/dockerfiles/tree/master/kaniko-openshift

No changes necessary to UID, this image should handle the default OS UID magic.

I have also based it on alpine to make it work with Jenkins and to easily add CA certificates (or anything else you might need.)
It is not maintained so if you intend to use it please copy & paste the files and maintain it.

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

5 participants