<< July 2016 | Home | September 2016 >>

Docker: Use host-network on docker container

If running a docker-container you have a network of your own per container. If you want to use the host-system's network instead you can use the --net=host option.

In this sample you call the docker containers arangodb arangoimp-call and connect with 127.0.0.1 which would not be possible if not using --net=host e.g.:

sudo docker run --net=host --rm --volumes-from arangodb-data_3.0 \
    -v $(pwd):/backup arangodb:3.0.4 /usr/bin/arangoimp \
    --server.endpoint tcp://127.0.0.1:8530 --server.database pwatch \
    --server.username uname --server.password pass
Tags : ,

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

Docker Bash

How to connect to a docker shell of an running docker-container

$ sudo docker exec -i -t 665b4a1e17b6 /bin/bash #by ID or $ sudo docker exec -i -t loving_heisenberg /bin/bash #by Name $ root@665b4a1e17b6:/#

If you want to get on the CLI of an running docker-container just use docker's exec command.

sudo docker

  • by-name:

  • First list all running containers:

    sudo docker ps

This will result in something like this: docker ps

Now you can call the container's bash-exe and you get on the CLI. You can do this by name or by container-id

  • by name

    sudo docker exec -i -t arangodb-server /bin/bash
  • by container-id

    sudo docker exec -i -t 8fd98d632eb2 /bin/bash
Tags : ,

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!
<< July 2016 | Home | September 2016 >>