summaryrefslogtreecommitdiff
path: root/notes/frameworks/docker.md
blob: af703c0ef261d160da11a10e1561bf7af502364a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Docker 

#### Useful Docker commands

- list names of running containers: `docker ps`
- log int to docker: `docker exec -ti -u root container_name bash`
- reload daemon: `sudo systemctl daemon-reload`
- restart docker `sudo systemctl restart docker`

#### Change Image Storage Location

- Using many docker images can use several hundred GBs of store. It's often useful to move this off your statup disk
- Edit `sudo nano /etc/docker/daemon.json`
- Add
```
{
  "data-root": "/path/to/new/docker"
}
```
- stop docker `sudo systemctl stop docker`
- check docker has stopped `ps aux | grep -i docker | grep -v grep`
- copy data to new location `sudo rsync -axPS /var/lib/docker/ /path/to/new/docker`
- `sudo rsync -axPS /var/lib/docker/ /media/ubuntu/disk_name/data_store/docker_images` to copy to your new disk


#### Permissions

- permissions still not solved, but here are useful tips: <http://www.carlboettiger.info/2014/10/21/docker-and-user-permissions-crazyness.html>