Tag: Docker
-
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 […]
-
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, […]
-
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 […]
-
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 […]
-
Docker: Defining Custom Location for Named Volume
PROBLEM Let’s assume we have the following docker-compose.yml: By the default, all Docker-managed named volumes are stored under the installed Docker directory… typically, /var/lib/docker/volumes/[path]. However, it is possible /var mount is low on disk space. SOLUTION It appears we can create a custom location for the given named volume:- Keep in mind /data/jenkins must be […]