Beruflich Dokumente
Kultur Dokumente
04
64-bit OS
Kernel version 3.10 or higher
https://www.linuxtechi.com/how-to-setup-docker-on-ubuntu-server-16-04/ 1/13
1/11/2017 How to Setup Docker on Ubuntu Server 16.04
https://www.linuxtechi.com/how-to-setup-docker-on-ubuntu-server-16-04/ 2/13
1/11/2017 How to Setup Docker on Ubuntu Server 16.04
linuxtechi@docker:~$ sudo
systemctl start docker
linuxtechi@docker:~$ sudo
systemctl enable docker
https://www.linuxtechi.com/how-to-setup-docker-on-ubuntu-server-16-04/ 3/13
1/11/2017 How to Setup Docker on Ubuntu Server 16.04
https://www.linuxtechi.com/how-to-setup-docker-on-ubuntu-server-16-04/ 4/13
1/11/2017 How to Setup Docker on Ubuntu Server 16.04
https://www.linuxtechi.com/how-to-setup-docker-on-ubuntu-server-16-04/ 5/13
1/11/2017 How to Setup Docker on Ubuntu Server 16.04
Provision or launch a
container using docker run
command
Let’s suppose we want provision a Ubuntu
16:04 container.
IMAGE
COMMAND
CREATED
STATUS
PORTS NAMES
b5cdf552b56c
ubuntu:16.04
"/bin/bash" 9 minutes
ago Up 9
minutes
mycontainer1
linuxtechi@docker:~$
https://www.linuxtechi.com/how-to-setup-docker-on-ubuntu-server-16-04/ 7/13
1/11/2017 How to Setup Docker on Ubuntu Server 16.04
Starting a Container in
detach mode.
Let’s suppose we want provision one more
container with the name ‘mycontainer2’
from centos7 docker image in detach mode(
i.e container will be launched in the
background and will not get console), to get
the console use docker attach command
https://www.linuxtechi.com/how-to-setup-docker-on-ubuntu-server-16-04/ 8/13
1/11/2017 How to Setup Docker on Ubuntu Server 16.04
mycontainer2
b5cdf552b56c
ubuntu:16.04
"/bin/bash" 28 minutes
ago Up 9
minutes
mycontainer1
https://www.linuxtechi.com/how-to-setup-docker-on-ubuntu-server-16-04/ 9/13
1/11/2017 How to Setup Docker on Ubuntu Server 16.04
Commit changes of a
container to a Docker
Image
In docker command we have commit
option to save the changes of container to a
docker image. Let’s assume in above
container we have installed web server and
want save these changes to a docker image
so that in future we can launch web server
container from docker image.
https://www.linuxtechi.com/how-to-setup-docker-on-ubuntu-server-16-04/ 10/13
1/11/2017 How to Setup Docker on Ubuntu Server 16.04
linuxtechi@docker:~$
Terminate / delete
containers using ‘docker
rm’ command
Use ‘docker rm‘ command to delete
containers either based on their names and
ids, Before deleting a container make sure
it is stopped.
https://www.linuxtechi.com/how-to-setup-docker-on-ubuntu-server-16-04/ 11/13
1/11/2017 How to Setup Docker on Ubuntu Server 16.04
linuxtechi@docker:~$
https://www.linuxtechi.com/how-to-setup-docker-on-ubuntu-server-16-04/ 12/13
1/11/2017 How to Setup Docker on Ubuntu Server 16.04
push docker-registry-
{user_name}/{docker_image_name}
https://www.linuxtechi.com/how-to-setup-docker-on-ubuntu-server-16-04/ 13/13