Docker command fails during build, but succeeds while executed within running container

The pwd is not persistent across RUN commands. You need to cd and configure within the same RUN. This Dockerfile works fine: FROM ubuntu:12.10 RUN apt-get update RUN apt-get -y install libpcre3 libssl-dev RUN apt-get -y install libpcre3-dev RUN apt-get -y install wget zip gcc RUN wget http://nginx.org/download/nginx-1.4.1.tar.gz RUN gunzip nginx-1.4.1.tar.gz RUN tar -xf nginx-1.4.1.tar … Read more

Docker compose error while creating mount source path

It’s likely a pathing issue with Docker when installed with snap, you’re better off installing it with the official documentation from Docker. Remove docker from snap snap remove docker Remove the docker directory, and old version (It’s okay if these don’t exist already) rm -R /var/lib/docker sudo apt-get remove docker docker-engine docker.io Install the official … Read more

Docker buildkit cache location/size and ID

Yes, it is somewhat vague in docker 20.10.5. Could use a pull request or two to update documentation. The docker driver cache uses the same storage driver as used for image layers. Metadata is stored in databases at /var/lib/docker/buildkit. When docker uses overlay2 storage driver, the layer is in /var/lib/docker/overlay2/<ID>/diff/. For <ID>, see below. /var/lib/docker … Read more

How to create a queue in RabbitMQ upon startup

You can predefine queues and exchanges without creating own rabbit-mq docker image. Your docker-compose should look like this: rabbit: container_name: rabbitmq-preload-conf image: rabbitmq:3-management volumes: – ./init/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro – ./init/definitions.json:/etc/rabbitmq/definitions.json:ro ports: – “5672:5672” – “15672:15672” In this case rabbitmq.conf and definitions.json files should be in init folder in the same parent folder as docker-compose file rabbitmq.conf file … Read more

Using current user when running container in docker-compose

Building on top of the answer by Joepreludian, focusing on docker-compose: You can use the user: and volumes: options in the compose file. For example: my-service: image: ubuntu:latest user: ${MY_UID}:${MY_GID} volumes: – /etc/passwd:/etc/passwd:ro – /etc/group:/etc/group:ro and define these variables where you are starting your compose: MY_UID=”$(id -u)” MY_GID=”$(id -g)” docker-compose up

Enable Ingress controller on Docker Desktop with WLS2

Finally I found the way to fix. I have to deploy ingress Nginx by command: kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.41.2/deploy/static/provider/cloud/deploy.yaml (Follows the instruction at https://kubernetes.github.io/ingress-nginx/deploy/#docker-for-mac. It works just fine for Docker for Windows) Now I can access http://ingress.local successfully.

Running headless Chrome / Puppeteer with –no-sandbox

I was hitting a similar problem trying to run Chromium headless in an Alpine Docker container, and apparently so are many other (e.g., here, here). The –no-sandbox option is a straightforward workaround but obviously a poor security practice. What worked for me was setting a custom seccomp. Download this file (if interested, see the author’s … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)