Docker-in-Docker vs Docker-out-of-Docker

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.

Load Groovy Script in Jenkins Pipeline

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.

Updating Jenkins Pipeline Shared Libraries

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.

Docker: Copy File Into a Container

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.

Docker: Override ENTRYPOINT

In this entry, we go over common mistakes when we try to override ENTRYPOINT in a Docker image and how to do it properly.

Docker: Root User in a Pod

In the following scenario, we have some pod running in Kubernetes cluster.

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.