Docker

Containers and registries

Docker hub

GitLab

Proxies (at GitLab)

Test wrappers (at GitLab)

Get private IP address of container

docker inspect --format="{{.NetworkSettings.IPAddress}}" [container id or name]

Use LVM thin pool

$ systemctl stop docker
$ rm -rf /var/lib/docker
$ pvcreate /dev/vdb
$ vgcreate docker_vol /dev/vdb
$ vi /etc/sysconfig/docker-storage-setup
VG="docker_vol"
$ docker-storage-setup

Use OverlayFS

Docker container engine

If running Docker engine from docker.io:

systemctl stop docker
vi /usr/lib/systemd/system/docker.servic

and add --storage-driver=overlay to ExecStart.

rm -rf /var/lib/docker/  # This will remove your existing images/containers
systemctl daemon-reload
systemctl start docker

Verify with:

docker info | grep Storage

overlay will be shown instead of devicemapper.

Fedora/CentOS

For Fedora/CentOS you can use docker-storage-setup to setup the storage driver.

To use OverlayFS

$ systemctl stop docker
$ vi /etc/sysconfig/docker-storage
`DOCKER_STORAGE_OPTIONS= -s overlay`
$ rm -rf /var/lib/docker
$ docker-storage-setup
$ systemctl start docker

Note:

  • This involves removing existing images and containers!
  • SELinux is not supported with the OverlayFS driver

Source, more info GitHub

Registry

SELinux errors

If you get 'permission denied' from the container and you use CentOS/Fedora, you likely ran into SELinux permission not given:

Relabel the target with:

$ chcon -Rt svirt_sandbox_file_t [location]

Remove untagged images

$ docker rmi $(docker images -a | grep "^<none>" | awk '{print $3}')
$ docker rmi $(docker images -f "dangling=true" -q)

Export / Import

Used for containers

$ docker run -d --name devenv gbraad/c9ide:f24
$ docker stop devenv
$ docker export devenv > devenv-f24.tar

Save / Load

Used for images

$ docker save gbraad/c9ide:c7 > c9ide-c7.tar

My repositories (on GitHub; after rename)

Source for images

Containerized libvirt

Brew of wellknown distributions

Source for GitLab proxies/container registries

results matching ""

    No results matching ""