• Docker ENTRYPOINT vs CMD

    3 min read

    Docker ENTRYPOINT CMD Dockerfile

    Docker is a popular tool for deploying and running applications in a containerized environment. One of the important features of Docker is the ability to define a command to be executed when a container is started. This command can be specified in the Dockerfile using two keyword: ENTRYPOINT and CMD.

    02/05/2023

    Read more...
  • AWS CLI in alpine

    1 min read

    alpine awscli pip

    The AWS CLI is a command line interface for interacting with AWS services. To install it in an Alpine-based container we can use pip instead of going thru all the trouble of downloading a zip and install it by running some script.

    09/02/2023

    Read more...
  • Container with alpine failing to execute a file with not found

    3 min read

    docker alpine not found error

    While building a container using alpine as a base image we can get a not found error while trying to execute a file that doesn't make much sense:

    $ docker run -it test /usr/local/bin/example-app
    exec /usr/local/bin/example-app: no such file or directory
    

    14/11/2022

    Read more...
  • How docker generates container's names

    2 min read

    docker names

    Everytime you create a container using docker, if not already set using --name, docker chooses a name for you: you can expect two words with a underscore:

    $ docker run --rm -d alpine sleep 24h
    38c4cc4e87762fc113ef174e9a4989e13d21037678abd3fe73840b825f14c7bf
    $ docker ps
    CONTAINER ID   IMAGE                          COMMAND                  CREATED         STATUS                PORTS                    NAMES
    38c4cc4e8776   alpine                         "sleep 24h"              5 seconds ago   Up 3 seconds                                   romantic_shtern
    

    For this example it was chosen romantic_shtern, but it can use a great variety of words:

    $ docker ps --all | grep -v "Up" | awk '{ print $NF }'
    NAMES
    mystifying_poitras
    suspicious_shtern
    focused_chatelet
    keen_mendel
    happy_jackson
    xenodochial_margulis
    kind_blackburn
    gallant_pascal
    trusting_thompson
    (...)
    

    So, how does Docker generate names for it's containers?

    01/08/2022

    Read more...
  • Docker: Using the host's network

    2 min read

    If we use the --net=host option with docker to create a new container, it will share it's network namespace with the host machine. It's main advantage is that it will provide higher performance (it will be close to bare metal speed); however, we might get port conflicts.

    24/02/2022

    Read more...

Older content...

From pet to cattle
Treat your kubernetes clusters like cattle, not pets