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

Example building a docker image with Kaniko #312

Merged
merged 2 commits into from
May 17, 2018
Merged

Example building a docker image with Kaniko #312

merged 2 commits into from
May 17, 2018

Conversation

carlossg
Copy link
Contributor

No description provided.

*
* You need to create a jenkins-docker-cfg secret with your docker config
* as described in
* https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#create-a-secret-in-the-cluster-that-holds-your-authorization-token
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those instructions are specifically for pulling images used by a pod - not for pushing to a registry. I had to use the following secret configuration to make sure the Docker credentials were placed in ~/.docker/config.json:

...
     volumeMounts:
       - name: jenkins-docker-cfg
         mountPath: /root/.docker
   volumes:
     - name: jenkins-docker-cfg
       secret:
         secretName: jenkins-docker-cfg
         items:
         - key: .dockerconfigjson
           path: config.json

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tried, but I assumed it was the same format, will take a look.

This I have tried GoogleContainerTools/kaniko#129

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured it out, the docker-registry secret type crates a .dockercfg file that needs to be put in root
It does not create the new .docker/config.json format

The docker-registry secret type crates a .dockercfg file that needs to be put in root

It does not create the new .docker/config.json format
spec:
containers:
- name: kaniko
image: csanchez/kaniko:jenkins # we need a patched version of kaniko for now
Copy link

@StevenACoffman StevenACoffman May 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlossg Is this because of GoogleContainerTools/kaniko#129 or something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kmadel
Copy link

kmadel commented May 20, 2018

Are you sure that nohup is in your image. Seeing this:

[testKanikoExample] Running shell script
/bin/sh: nohup: not found
EXITCODE 127[Pipeline] }

@StevenACoffman
Copy link

StevenACoffman commented May 20, 2018

coreutils contents show nohup in /usr/bin but the PATH does not include that in the docker file

ENV PATH /bin:/usr/local/bin

@carlossg
Copy link
Contributor Author

fixed and image is building in dockerhub

hrishin pushed a commit to fabric8io/kubernetes-plugin that referenced this pull request May 23, 2018
The docker-registry secret type crates a .dockercfg file that needs to be put in root

It does not create the new .docker/config.json format
MattLud pushed a commit to MattLud/kubernetes-plugin that referenced this pull request May 29, 2018
The docker-registry secret type crates a .dockercfg file that needs to be put in root

It does not create the new .docker/config.json format
MattLud pushed a commit to MattLud/kubernetes-plugin that referenced this pull request May 29, 2018
The docker-registry secret type crates a .dockercfg file that needs to be put in root

It does not create the new .docker/config.json format
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

Successfully merging this pull request may close these issues.

3 participants