In this Post, lets see how to Install Docker CE . I am using Oracle Linux Server 8.6 (Free Instance Offered by Oracle Cloud) .
Docker lets you build, test, and deploy applications quickly, Docker is a software platform that allows you to build, test, and deploy applications quickly. Docker packages software into standardized units called containers that have everything the software needs to run including libraries, system tools, code, and runtime. Using Docker, you can quickly deploy and scale applications into any environment and know your code will run.
Docker Compose is a tool that was developed to help define and share multi-container applications. With Compose, we can create a YAML file to define the services and with a single command, can spin everything up or tear it all down.
The big advantage of using Compose is you can define your application stack in a file, keep it at the root of your project repo (it’s now version controlled), and easily enable someone else to contribute to your project. Someone would only need to clone your repo and start the compose app
Note : If there is no repo available in your OS, try adding EPEL repo and Try again.
[root@certbot conf.d]# dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
Once the Repo is Added, we are good to go …..
run this command “dnf install docker-ce docker-ce-cli containerd.io”
[root@certbot conf.d]# dnf install docker-ce docker-ce-cli containerd.io
Last metadata expiration check: 0:00:57 ago on Wed 21 Sep 2022 08:05:23 PM GMT.
Dependencies resolved.
=============================================================================================================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================================================================================================
Installing:
containerd.io x86_64 1.6.8-3.1.el8 docker-ce-stable 33 M
docker-ce x86_64 3:20.10.18-3.el8 docker-ce-stable 21 M
docker-ce-cli x86_64 1:20.10.18-3.el8 docker-ce-stable 30 M
Installing dependencies:
container-selinux noarch 2:2.188.0-1.module+el8.6.0+20721+d8d917a9 ol8_appstream 59 k
docker-ce-rootless-extras x86_64 20.10.18-3.el8 docker-ce-stable 4.6 M
fuse-common x86_64 3.3.0-15.0.2.el8 ol8_baseos_latest 22 k
fuse-overlayfs x86_64 1.9-1.module+el8.6.0+20721+d8d917a9 ol8_appstream 73 k
fuse3 x86_64 3.3.0-15.0.2.el8 ol8_baseos_latest 55 k
fuse3-libs x86_64 3.3.0-15.0.2.el8 ol8_baseos_latest 95 k
libcgroup x86_64 0.41-19.el8 ol8_baseos_latest 70 k
libslirp x86_64 4.4.0-1.module+el8.6.0+20721+d8d917a9 ol8_appstream 70 k
slirp4netns x86_64 1.2.0-2.module+el8.6.0+20721+d8d917a9 ol8_appstream 54 k
Installing weak dependencies:
docker-scan-plugin x86_64 0.17.0-3.el8 docker-ce-stable 3.8 M
Enabling module streams:
container-tools ol8
Transaction Summary
=============================================================================================================================================================================================================================================
Install 13 Packages
Total download size: 92 M
Installed size: 365 M
Is this ok [y/N]: y
Downloading Packages:
(1/13): docker-ce-20.10.18-3.el8.x86_64.rpm 12 MB/s | 21 MB 00:01
(2/13): docker-ce-rootless-extras-20.10.18-3.el8.x86_64.rpm 8.1 MB/s | 4.6 MB 00:00
(3/13): docker-scan-plugin-0.17.0-3.el8.x86_64.rpm 9.5 MB/s | 3.8 MB 00:00
(4/13): docker-ce-cli-20.10.18-3.el8.x86_64.rpm 10 MB/s | 30 MB 00:02
(5/13): fuse-common-3.3.0-15.0.2.el8.x86_64.rpm 78 kB/s | 22 kB 00:00
(6/13): fuse3-3.3.0-15.0.2.el8.x86_64.rpm 650 kB/s | 55 kB 00:00
(7/13): fuse3-libs-3.3.0-15.0.2.el8.x86_64.rpm 7.8 MB/s | 95 kB 00:00
(8/13): container-selinux-2.188.0-1.module+el8.6.0+20721+d8d917a9.noarch.rpm 11 MB/s | 59 kB 00:00
(9/13): fuse-overlayfs-1.9-1.module+el8.6.0+20721+d8d917a9.x86_64.rpm 10 MB/s | 73 kB 00:00
(10/13): containerd.io-1.6.8-3.1.el8.x86_64.rpm 9.9 MB/s | 33 MB 00:03
(11/13): libcgroup-0.41-19.el8.x86_64.rpm 206 kB/s | 70 kB 00:00
(12/13): libslirp-4.4.0-1.module+el8.6.0+20721+d8d917a9.x86_64.rpm 219 kB/s | 70 kB 00:00
(13/13): slirp4netns-1.2.0-2.module+el8.6.0+20721+d8d917a9.x86_64.rpm 2.2 MB/s | 54 kB 00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 27 MB/s | 92 MB 00:03
Docker CE Stable - x86_64 85 kB/s | 1.6 kB 00:00
Importing GPG key 0x621E9F35:
Userid : "Docker Release (CE rpm) <docker@docker.com>"
Fingerprint: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
From : https://download.docker.com/linux/centos/gpg
Is this ok [y/N]: Y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : docker-scan-plugin-0.17.0-3.el8.x86_64 1/13
Running scriptlet: docker-scan-plugin-0.17.0-3.el8.x86_64 1/13
Installing : docker-ce-cli-1:20.10.18-3.el8.x86_64 2/13
Running scriptlet: docker-ce-cli-1:20.10.18-3.el8.x86_64 2/13
Running scriptlet: container-selinux-2:2.188.0-1.module+el8.6.0+20721+d8d917a9.noarch 3/13
Installing : container-selinux-2:2.188.0-1.module+el8.6.0+20721+d8d917a9.noarch 3/13
Running scriptlet: container-selinux-2:2.188.0-1.module+el8.6.0+20721+d8d917a9.noarch 3/13
Installing : fuse3-libs-3.3.0-15.0.2.el8.x86_64 4/13
Running scriptlet: fuse3-libs-3.3.0-15.0.2.el8.x86_64 4/13
Installing : containerd.io-1.6.8-3.1.el8.x86_64 5/13
Running scriptlet: containerd.io-1.6.8-3.1.el8.x86_64 5/13
Installing : libslirp-4.4.0-1.module+el8.6.0+20721+d8d917a9.x86_64 6/13
Installing : slirp4netns-1.2.0-2.module+el8.6.0+20721+d8d917a9.x86_64 7/13
Running scriptlet: libcgroup-0.41-19.el8.x86_64 8/13
Installing : libcgroup-0.41-19.el8.x86_64 8/13
Running scriptlet: libcgroup-0.41-19.el8.x86_64 8/13
Installing : fuse-common-3.3.0-15.0.2.el8.x86_64 9/13
Installing : fuse3-3.3.0-15.0.2.el8.x86_64 10/13
Installing : fuse-overlayfs-1.9-1.module+el8.6.0+20721+d8d917a9.x86_64 11/13
Running scriptlet: fuse-overlayfs-1.9-1.module+el8.6.0+20721+d8d917a9.x86_64 11/13
Installing : docker-ce-rootless-extras-20.10.18-3.el8.x86_64 12/13
Running scriptlet: docker-ce-rootless-extras-20.10.18-3.el8.x86_64 12/13
Installing : docker-ce-3:20.10.18-3.el8.x86_64 13/13
Running scriptlet: docker-ce-3:20.10.18-3.el8.x86_64 13/13
Running scriptlet: container-selinux-2:2.188.0-1.module+el8.6.0+20721+d8d917a9.noarch 13/13
Running scriptlet: docker-ce-3:20.10.18-3.el8.x86_64 13/13
Verifying : containerd.io-1.6.8-3.1.el8.x86_64 1/13
Verifying : docker-ce-3:20.10.18-3.el8.x86_64 2/13
Verifying : docker-ce-cli-1:20.10.18-3.el8.x86_64 3/13
Verifying : docker-ce-rootless-extras-20.10.18-3.el8.x86_64 4/13
Verifying : docker-scan-plugin-0.17.0-3.el8.x86_64 5/13
Verifying : fuse-common-3.3.0-15.0.2.el8.x86_64 6/13
Verifying : fuse3-3.3.0-15.0.2.el8.x86_64 7/13
Verifying : fuse3-libs-3.3.0-15.0.2.el8.x86_64 8/13
Verifying : libcgroup-0.41-19.el8.x86_64 9/13
Verifying : container-selinux-2:2.188.0-1.module+el8.6.0+20721+d8d917a9.noarch 10/13
Verifying : fuse-overlayfs-1.9-1.module+el8.6.0+20721+d8d917a9.x86_64 11/13
Verifying : libslirp-4.4.0-1.module+el8.6.0+20721+d8d917a9.x86_64 12/13
Verifying : slirp4netns-1.2.0-2.module+el8.6.0+20721+d8d917a9.x86_64 13/13
Installed:
container-selinux-2:2.188.0-1.module+el8.6.0+20721+d8d917a9.noarch containerd.io-1.6.8-3.1.el8.x86_64 docker-ce-3:20.10.18-3.el8.x86_64 docker-ce-cli-1:20.10.18-3.el8.x86_64
docker-ce-rootless-extras-20.10.18-3.el8.x86_64 docker-scan-plugin-0.17.0-3.el8.x86_64 fuse-common-3.3.0-15.0.2.el8.x86_64 fuse-overlayfs-1.9-1.module+el8.6.0+20721+d8d917a9.x86_64
fuse3-3.3.0-15.0.2.el8.x86_64 fuse3-libs-3.3.0-15.0.2.el8.x86_64 libcgroup-0.41-19.el8.x86_64 libslirp-4.4.0-1.module+el8.6.0+20721+d8d917a9.x86_64
slirp4netns-1.2.0-2.module+el8.6.0+20721+d8d917a9.x86_64
Complete!
Enable and Start the docker Service
[root@certbot conf.d]# systemctl enable docker
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
[root@certbot conf.d]# systemctl start docker
Command “Docker PS” shows the running dockers.
[root@certbot conf.d]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Lets Install Docker Compose as follows
[root@certbot conf.d]# curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o docker-compose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 11.2M 100 11.2M 0 0 44.9M 0 --:--:-- --:--:-- --:--:-- 44.9M
[root@certbot conf.d]# mv docker-compose /usr/local/bin && sudo chmod +x /usr/local/bin/docker-compose
[root@certbot conf.d]# docker-compose version
docker-compose version 1.23.2, build 1110ad01
docker-py version: 3.6.0
CPython version: 3.6.7
OpenSSL version: OpenSSL 1.1.0f 25 May 2017
[root@certbot conf.d]#
Add user to docker group (if not already added)
sudo usermod -aG docker $USER
2. create a symbolic link to /usr/bin using the following command
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
3. Restart docker service
$ sudo service docker restart
Lets see the Available Commands with Docker help, We can discuss more on these commands in the Next Part
See 'docker --help'.
Usage: docker [OPTIONS] COMMAND
A self-sufficient runtime for containers
Options:
--config string Location of client config files (default "/root/.docker")
-c, --context string Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with "docker context use")
-D, --debug Enable debug mode
-H, --host list Daemon socket(s) to connect to
-l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
--tls Use TLS; implied by --tlsverify
--tlscacert string Trust certs signed only by this CA (default "/root/.docker/ca.pem")
--tlscert string Path to TLS certificate file (default "/root/.docker/cert.pem")
--tlskey string Path to TLS key file (default "/root/.docker/key.pem")
--tlsverify Use TLS and verify the remote
-v, --version Print version information and quit
Management Commands:
app* Docker App (Docker Inc., v0.9.1-beta3)
builder Manage builds
buildx* Docker Buildx (Docker Inc., v0.7.1-docker)
config Manage Docker configs
container Manage containers
context Manage contexts
image Manage images
manifest Manage Docker image manifests and manifest lists
network Manage networks
node Manage Swarm nodes
plugin Manage plugins
scan* Docker Scan (Docker Inc., v0.12.0)
secret Manage Docker secrets
service Manage services
stack Manage Docker stacks
swarm Manage Swarm
system Manage Docker
trust Manage trust on Docker images
volume Manage volumes
Commands:
attach Attach local standard input, output, and error streams to a running container
build Build an image from a Dockerfile
commit Create a new image from a container's changes
cp Copy files/folders between a container and the local filesystem
create Create a new container
diff Inspect changes to files or directories on a container's filesystem
events Get real time events from the server
exec Run a command in a running container
export Export a container's filesystem as a tar archive
history Show the history of an image
images List images
import Import the contents from a tarball to create a filesystem image
info Display system-wide information
inspect Return low-level information on Docker objects
kill Kill one or more running containers
load Load an image from a tar archive or STDIN
login Log in to a Docker registry
logout Log out from a Docker registry
logs Fetch the logs of a container
pause Pause all processes within one or more containers
port List port mappings or a specific mapping for the container
ps List containers
pull Pull an image or a repository from a registry
push Push an image or a repository to a registry
rename Rename a container
restart Restart one or more containers
rm Remove one or more containers
rmi Remove one or more images
run Run a command in a new container
save Save one or more images to a tar archive (streamed to STDOUT by default)
search Search the Docker Hub for images
start Start one or more stopped containers
stats Display a live stream of container(s) resource usage statistics
stop Stop one or more running containers
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
top Display the running processes of a container
unpause Unpause all processes within one or more containers
update Update configuration of one or more containers
version Show the Docker version information
wait Block until one or more containers stop, then print their exit codes
Run 'docker COMMAND --help' for more information on a command.
To get more help with docker, check out our guides at https://docs.docker.com/go/guides/
Like this:
Like Loading...