HEALTHCHECK: Dockerfile vs docker-compose.yml

Adding health check to the Dockerfile, will make the health-check part of the image, so that anyone pulling the image from the registry will get the health check by default. Compose files are usually less shared than the actual docker images they run. The dockercompose health-check allows adding/overrriding healthchecks for images for someone who is … Read more

“network not manually attachable” when running one-off command against docker swarm network

Using composer Since composer v3.2 it is possible to configure the attachable property through the composer file using the keyword attachable like: networks: mynet1: driver: overlay attachable: true Using docker network create Since Docker Engine API v1.25 it is possible to create a network and make it attachable using the –attachable parameter like: docker network … Read more

local development of microservices, methods and tools to work efficiently

I’ve had a fair amount of experience with microservices and local development and here’s been some approaches I’ve seen: Run all the things locally on docker or k8. If using k8, then a tool like skaffolding can make it easier to run and debug a service locally in the IDE but put it into your … Read more

How is Docker Swarm different than Kubernetes?

There are lots of articles out there which will explain the differences. In a nutshell: Both are trying to solve the same problem – container orchestration over a large number of hosts. Essentially these problems can be broken down like so: Scheduling containers across multiple hosts (taking into account resource utilization etc) Grouping containers into … Read more

docker stack deploy results in “No such image error”

Already found the solution. My image is hosted on a private repository. Besides the swarm manager (where I executed the commands), I had a running swarm worker. When I ran docker stack deploy -c docker-compose.yml myapp docker deployed the service to the worker node (not the manager node as I thought). At the worker node, … Read more

docker service replicas remain 0/1

The problem is that your tasks (calling bin/bash) exits quickly since it’s not doing anything. If you look at the tasks for your service, you’ll see that one is started and then shutdown within seconds. Another one is then started, shutdown and so on, since you’re requested that 1 task be running at all times. … Read more

tech