O'Reilly logo

CoreOS Essentials by Rimantas Mocevicius

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reading and writing from the application container

Usually, application containers (this is a general term for docker, rkt, and other types of containers) do not have etcdctl or even curl installed by default. Installing curl is much easier than installing etcdctl.

For our example, we will use the Alpine Linux docker image, which is very small in size and will not take much time to pull from the docker registry:

  1. Firstly, we need to check the docker0 interface IP, which we will use with curl:
    $ echo"$(ifconfig docker0 | awk'/\<inet\>/ { print $2}'):2379"
    10.1.42.1:2379
    
  2. Let's run the docker container with a bash shell:
    $ docker run -it alpine ash
    

    We should see something like this in Command Prompt:/ #.

  3. As curl is not installed by default on Alpine ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required