Skip to content

Instantly share code, notes, and snippets.

@yuriploc
Last active April 2, 2019 00:23
Show Gist options
  • Save yuriploc/f6469842cb8d2fdac3833efa15154fbe to your computer and use it in GitHub Desktop.
Save yuriploc/f6469842cb8d2fdac3833efa15154fbe to your computer and use it in GitHub Desktop.
Docker nice commands

Copy from host to container

docker cp ~/path/local/file  <CONTAINER-ID>:/home/path/container/file

Run bash in container

docker exec -t -i <CONTAINER-ID> /bin/bash

Run GUI app in Docker

docker run -ti --rm -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority --net=host --pid=host --ipc=host  <DOCKER-IMG-NAME>

Help from this post.

Build docker image

docker build -t <DOCKER-IMG-NAME>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment