Posts tagged docker

jenkins-docker-180x180

Jenkins Amazon ECR token update

0

With the use of the Jenkins Docker Pipeline plugin, it’s easy to build and push Docker images.    

For example, building in a Jenkinsfile:

script {
    dockerImage = docker.build("${env.DOCKER_IMAGE_TAG}",  "${args}")
}

And push:

script {
    docker.withRegistry("${env.DOCKER_PRIVATE_REGISTRY_URL}",
            "docker-private-registry-${env.DEPLOY_ENVIRONMENT}") {
        dockerImage.push("${env.DOCKER_IMAGE_SHORT_PUSH_TAG}")
    }
}

The Docker registry username and password are provided by the credential ID “docker-private-registry-${env.DEPLOY_ENVIRONMENT}”. However Amazon ECR uses tokens that are only valid for 12 hours. So the password that you specify when creating the credential will only work in the example above for a short period of time.

With the following script it’s More >

jenkins-docker-180x180

Jenkinsfile Docker pipeline multi stage

0

Using a Jenkinsfile to configure the Jenkins build job for source code is great. Jenkins has a very nice Docker Pipeline plugin that makes it possible to execute docker commands nicely during the build.

Note: Don’t forget to read on this page the update of 16 august 2018.

However, a lot of the examples at https://jenkins.io/doc/book/pipeline/docker/ keep it very simple. They start and stop in one pipeline stage, with methods like docker.inside or docker.withRun. For example, building a container, running it, executing commands in it and destroy it, all within one stage. For several use More >

minikube-square

Minikube NFS mounts

2

Minikube is great for having a Kubernetes cluster as local Docker development environment. In a development workflow you probably have source code on your host machine and it would be great if the Docker containers in the Kubernetes cluster could mount this. So changes made to the code can be tested and are visible quickly. The steps on this blog post are tested with Minikube version v0.28.0.

Mounting is possible for example with:

minikube start --mount --mount-string ./sources:/sources

And by using hostPath in the volume.

---

More >

Go to Top