TIL: Docker Debugging and Exit Codes

Read more →

TIL: strongSwan using bypass-lan Plugin Can Fix Docker Routing

Let Docker access the internet by passing through the VPN connection My host machine, a laptop running Manjaro Linux, is connected via VPN to the internet. I use strongSwan, the open-source IPsec-based VPN solution. IPsec with the IKEv2 protocol is fast and secure. Now, Docker doesn't work. Networking issues are a common problem with VPN and Docker. You can piggyback your Docker container on the host network. That technique only works on Linux machines.
Read more →

Friday Picks 037

Read more →

TIL: Docker: chown Copies All Files

Docker builds containers via layers. All commands add another layer to the already existing image. What does that mean for changing file permissions via chown or chmod? Let's say we build this image: FROMfrolvlad/alpine-miniconda3:python3.7 AS build# set working directoryWORKDIR/usr/src/app# copy codeCOPY ./code /codeCOPY ./notebooks /notebooks# add non-root userRUN addgroup –system user && \ adduser –system -G user user && \ chown -R user:user /usr/src/appAfter copying the code from the host machine to the container, we switch permissions for the working directory from root to user.
Read more →

Friday Picks 035

Read more →

About Docker DNS and Networking

Read more →

Two Docker Resources

Read more →

Refactoring My Nim sqlite DB to Postgres

Today I've spent all my coding time on re-factoring my sqlite3 database to postgres. Nim and Jester (a web framework) ship with inbuilt sqlite3 features. I couldn't get them working within Docker. I know how to use Docker and Postgres. Plus, the wrapper library for Nim around SQL databases offers a consistent API. My re-factoring only needed minimal changes. The project is still in flux. And I have some annoying errors with Nim and SQL queries.
Read more →

Working on Nim URL Shortener With Docker

Read more →

TIL: You Can't Mount Host Volumes Into Docker During Build

Today I learned that you can't bind-mount folders on your host machine into a Docker container during build. For local development, I bind-mount with docker-compose. Example: version: '2.4'services: url-shortener: build: context: ./services/url-shortener dockerfile: Dockerfile volumes: - './services/url-shortener:/usr/src/app:delegated' ports: - 5001:5000My goal was to use the language's package manager to install the required dependencies. Here's the Dockerfile:

base imageFROMnimlang/nim:1.0.4-regular AS build-image# set working directoryWORKDIR/usr/src/app# install dependenciesRUN nimble refresh && nimble install -y# run serverCMD nimble c -r src/urlShortenerHere is the problem: nimble can't find the required files for installation.

Read more →