Pragmatism in the real world

Docker Compose DNS entries

Sometimes you need some additional DNS entries in your containers. This is how to do it in compose.yaml. Internal entries Within the containers, the name of the container in compose.yaml is resolvable via DNS. Given this compose.yaml: services: web: # … app: # … networks: myapp: driver: "bridge" We can ping web from within the app container. If we need to access the web container using another domain, we add it as a network alias:… continue reading.

Installing the SQL Server PHP extension in Docker on Mac

I'm working on a project that uses MS SQL Server as its database. Recently, I noticed that the SQL Server Docker container now works with Apple Silicon Macs, so looked into setting up a PHP-FPM container with the sqlsrv extension installed. I'm noting the relevant parts of my Dockerfile for when I need them again, so this is entirely an aide-mémoire! FROM ubuntu:22.04 # Install PHP as per https://akrabat.com/7126 ## Register the Microsoft package repository… continue reading.

Prevent the Docker container from taking 10 seconds to stop

For one project that I'm working on the PHP-FPM-based Docker container is built from a Ubuntu container with PHP is installed into it. A little like this: FROM ubuntu:22.04 RUN apt-get update && apt-get upgrade -y && apt-get install -y gnupg curl # Register the Ondrej package repo for PHP RUN mkdir -p /etc/apt/keyrings \ curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg –dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null \ && echo "deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main" >… continue reading.