Getting original client IP from a request in Docker Swarm – Or the issue with issue #25526

Puh…this is a big one… A client contacted me saying the webserver’s logs on one of our swarm stacks reports the same IP address for any request and it’s not one of any of the clients used: – 10.255.0.2 [18/Oct/2018:13:38:43 +0000] “GET / HTTP/1.0” 401 113 “HTTP-Monitor/1.1” 1 This is an issue as we require… Continue Reading Getting original client IP from a request in Docker Swarm – Or the issue with issue #25526

Docker – Add trusted root ca to local docker-machine swarm

As one might want when using a custom Docker registry with a cert signed by a custom root ca. As finding the answer to this question has proven somewhat complicated, I’ll note my approach here for future reference (excerpt): Basically, copy pem (Base64 encoded) versions of your CA trust chain into /var/lib/boot2docker/certs/. You can’t use… Continue Reading Docker – Add trusted root ca to local docker-machine swarm

Keep any Docker container running

By simply using docker run -d centos tail -f /dev/null as the CMD/Entrypoint. Read more: Docker container will automatically stop after “docker run -d”

Key management during Docker build

While building we often require private keys to checkout repositories or access other required, access-restricted assets. In this particular case it was a github checkout that required a private key to an account with access to the respective repository. The requirements were: The key must be present during the build process There must not be… Continue Reading Key management during Docker build

Building Docker images of node applications – The npm install issue

I am working on a Docker container array for a node application. Developers should work with it, it should be good to go to testing and production, Jenkins should be able to use it. There should be two seperate containers: One for running the ready-built code (run-container) and one for building everything on Jenkins and… Continue Reading Building Docker images of node applications – The npm install issue

Fix “error during connect: Get https://10.10.18.10:2376/v1.37/containers/json: x509: certificate has expired or is not yet valid”

So…this happened lately: $ docker ps error during connect: Get https://xx.xx.xx.xx:xxxx/vx.xx/containers/json: x509: certificate has expired or is not yet valid Browsing to the URL gave me: This site can’t provide a secure connection xx.xx.xx.xx didn’t accept your login certificate, or one may not have been provided. Try contacting the system admin. ERR_BAD_SSL_CLIENT_AUTH_CERT journalctl -u docker.service… Continue Reading Fix “error during connect: Get https://10.10.18.10:2376/v1.37/containers/json: x509: certificate has expired or is not yet valid”

Use Docker from inside a Docker container

Fascinatedly I found a little gem on the Docker forums! You can run docker inside a Docker container without running an own instance of the Docker daemon inside the container. With a simple hack you can use the host’s daemon inside the container! How? Just host the Docker unix socket as a volume into the… Continue Reading Use Docker from inside a Docker container