![]() ![]() You can read our Docker Tutorial to learn more about Docker. So we have successfully installed Docker on CentOS 7 and created our first docker container to run Apache Web Server. To list all containers, Type: docker ps -a Conclusion To list running containers on CentOS Docker engine, Type: docker ps To deploy a static website with Docker and nginx in CentOS 7, you can follow these steps: Install Docker: First, you need to install Docker on your CentOS 7 server. docker exec -ti docker-httpd /bin/bash List Containers on CentOS 7 ![]() We can get an interactive shell session to the container using the 'docker exec' command. ![]() I also mapped host port 80 to the port 80 of the new container. docker run -d -name docker-httpd -p 80:80 httpd:latestĪs per the above example, I started a new container called docker-httpd using the httpd image. Then, Start a new Docker Container with the 'docker run' command. Package version: docker-1.12.x86_64Ĭreate your first docker container on CentOS 7įor this example, I will run the Apache HTTPD Web Server on CentOS Docker Engine.įirst, Download the latest Apache httpd image using the 'docker pull' command. You should see the output something like the following: Client: To verify CentOS 7 Docker Installation, Type: docker version To install docker, Open the terminal and type: yum install docker docker-registryĪfter the installation is finished, start the docker service and enable to start docker automatically when system reboot. Hence, if you have firewalld enabled, you need to add a masquerade rule to it. systemctl enable -now docker CentOS 8 uses a firewall other than Docker. We will install the docker engine available from the CentOS Base repository. dnf install docker-ce docker-ce-cli containerd.io Start the Docker service and add it to autorun. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |