- [Show pagesource]
- [Old revisions]
- [[unknown link type]]
- []
This is an old revision of the document!
Table of Contents
Running docker container
docker run -v /srv/elgoog:/mnt -d algoo
- -d detached
- -v volumes to bind in format /path/at/host:/path/in/container
- -m memory limit
- -c cpu limit
Attach to the running container
- first discover all running containers on host
docker ps
- output:
root@xen-docker:~# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d5e31d1cbe9c algoo:latest supervisord -n 3 seconds ago Up 2 seconds 80/tcp furious_hopper ec704ed40100 algoo:latest supervisord -n 4 seconds ago Up 3 seconds 80/tcp distracted_babbage
- attach to the container by id
docker attach d5e31d1cbe9c
Copying files between host and container
- The cleanest way how to copy files between host and container is to mount an image to the container
docker run -v /path/to/hostdir:/mnt $container cp /mnt/sourcefile /path/to/destfile
docker/start.1425378894.txt.gz · Last modified: 2015/03/03 11:34 (external edit)