Tag: Docker
-
Cloud Run: Connecting to Cloud SQL with Private IP and SSL
There are various ways for a Cloud Run instance to connect to a Cloud SQL instance. Regardless of the solutions, if both resources reside in the same GCP organization, connecting using a Cloud SQL’s private IP with SSL/TLS encryption is highly recommended to prevent network traffic from going out to the internet. It is possible… Read More…
-
Supercharge Docker Build Pipeline by 97%
This tutorial shows how to improve the performance of the remote pipeline that builds a Docker image using docker build, which takes 15 minutes to 20 seconds. Note: Although Google’s Cloud Build is used here, this solution can be applied in GitHub Actions, Azure Pipeline, or any pipeline-driven Docker builds. The Challenge with Docker Build… Read More…
-
GCSFuse + Docker: “Error while creating mount source path ‘/a’: mkdir /a: file exists.”
This post illustrates how you can mount a GCS bucket using GCSFuse on your host machine and expose it as a volume to a Docker container. PROBLEM You want to volume mount a FUSE-mounted directory to a container, for example: When attempting to run the container… … an error occurred: SOLUTION Unmount the existing FUSE-mounted… Read More…
-
GCP + Container Registry: Pushing/Pulling Images
PROBLEM You want to push a new image to Google Container Registry (GCR) or pull an existing image from GCR. SOLUTION Pushing a New Image to GCR Prepare your Dockerfile. Create an image and tag it with a path pointing to GCR within a project. There are several variations of GCR’s hostname (ex: gcr.io, us.gcr.io,… Read More…
-
Docker: Executing Startup Script When Running Container Interactively
PROBLEM When running the Docker container interactively (ex: docker run –rm -it myimage), you want to run a startup script every time. SOLUTION For Ubuntu, Debian and Centos images, write the startup script to /root/.bashrc: For Alpine image, it’s a little different because it uses Ash shell. Besides writing the startup script to /root/.profile, you… Read More…
-
Docker: Handling Circular Dependency between Containers
PROBLEM Let’s assume we are going to run 3 containers:- Nginx is used to serve cleaner URLs through reverse proxies so that users will access http://server/jenkins and http://server/nexus instead of remembering specific ports. So, the simplified docker-compose.yml looks like this:- While http://server/jenkins and http://server/nexus work flawlessly, the Jenkins container is unable to communicate with Nexus… Read More…