In this post, we look into two different approaches to solving the problem of building/pushing Docker images from a containerized Jenkins system. From that understanding, we will discuss the pros and cons of each approach in production Continuous Integration (CI) systems and how one should be used in practice.
In this post, we look into loading and reusing independent Groovy scripts for more modular and testable Jenkins pipeline. An example with Scripted Pipeline is provided although it is also applicable to newer Declarative Pipeline with minor modifications. Keep in mind that Jenkins Shared Libraries is the more scalable alternative to run and reuse custom Groovy scripts in Jenkins pipeline.
When you have multiple Pipeline jobs, you often want to share some parts of the Jenkinsfiles between them to keep Jenkinfiles DRY. A very common use case is that you have many projects that are built in the similar way, such as Nexus authentication step in Gradle build. One way is to use Workflow plugin. Comprehensive user documentation can be found in this section of Jenkins handbook.
In the following sections, we review a couple older, but not necessarily worse, ways of updating shared Groovy code which are still used in some Jenkins system.
In this post, we look into a perplexing issue that happens often when we try to extend an offical image.
In summary, there is currently no way to add additional content into
VOLUME directory in a trivial way.
If you unknowingly adds files into a folder that has been used as a
VOLUME mount point in a Docker image or one of its base images, the files cannot be found for seemingly no reason.
In this blog post, we have a running Docker container or a running pod in Kubernetes cluster. We want to add some files into the running containers to fix some issue, verify, and commit the changes.
In this entry, we go over common mistakes when we try to override
ENTRYPOINT in a Docker image and how to do it properly.
In the following scenario, we have some pod running in Kubernetes cluster.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
For troubleshooting purposes, we sometimes need to enter the container or execute some commands with root privilege.
Sometimes, we simply cannot
sudo or have the root password.