Docker 101: The Basics
I. How To Update/Upgrade Docker on Fedora 23
II. How To List and Attach to Docker Containers
III. How to Commit Changes and Create Docker Images
IV. How to View Logs for a Docker Container
Pre-Flight Check
- These instructions are specifically intended for upgrading/updating Docker on Fedora 23. If you’re using an older version of Fedora, check our tutorial for Fedora 22.
- We’ll be logging into a Liquid Web Self Managed Fedora 23 server as root.
Step #1: Upgrade/Update Docker on Fedora 23
To upgrade or update, simply enter:dnf upgrade -y docker-io
Step #2: Other Docker Commands
Docker already should be started, but if it isn’t you can start it with the following command:systemctl start docker
Docker also already should be configured to start when the server boots; if not, you can use the following command to do so:
systemctl enable docker
Step #3: Download a Docker Container
To get started using Docker, we’ll download the Fedora Docker image:docker pull fedora
Step #4: Run a Docker Container
Setting up a basic Fedora container with a bash shell requires a single command, “docker”:docker run -i -t fedora /bin/bash
Breaking down that command:
- docker run will run a command in a new container
- -i attaches stdin and stdout
- -t allocates a tty
- fedora indicates that we’ll be using the standard fedora container
- /bin/bash provides us with our shell
docker search fedora