- Centos 7 Dockerfile Example
- Centos Dockerfile Example Online
- Centos Dockerfile Example
- Centos Dockerfile Example Code
Browse The Most Popular 7 Docker Dockerfile Ansible Junos Open Source Projects. This is a Linux Docker image based on ekidd/rust-musl-builder but using debian:buster-slim. It contains essential tools for compile Rust projects such as Linux static binaries via musl-libc / musl-gcc ( x8664-unknown-linux-musl ) and macOS binaries ( x8664-apple-darwin ) via osxcross just using the same Linux image.
- Install / Initial Config
- NTP / SSH Server
- DNS / DHCP Server
- Storage Server
- Container Platform
- Cloud Compute
- Directory Server
- Web Server
- FTP / Samba / Mail
- Proxy / Load Balance
- Lang / Development
- Desktop / Others
- Others #2
- Bacula - Backup
- Memcached - Memory Cache
- RabbitMQ - Message Broker
- ElasticStack - Search Engine++
- Subversion - Revision Control
- Git - Revision Control
- Ansible - Config Manage
- PXE Boot- PXE Server
- Pacemaker - HA Cluster
- OpenVPN - VPN Server
- WireGuard - VPN Server
- NextCloud - Cloud Storage
- LVM - LVM Manage
Docker is an open source application container engine based on the go language. It can package the developer's application and dependent packages into a portable container, and then publish it to any popular Linux machine, which can greatly reduce the number of developers The workload of Docker can also be virtualized.
2. Docker installation
Docker has become very popular since its release. At present, Linux systems, windows systems and mac systems all support docker. This article introduces the installation and simple use of Docker with Linux systems .
Docker has not been released for a long time, so Linux also has restrictions on Docker support, which only supports 64-bit. Currently centos7 already supports Docker. The installation requires a 64-bit system and a kernel version of 3.10 or higher. For centos6, the installation requires centos6. .5 or higher, the same system is 64-bit, docker only supports 64-bit, and the kernel version is 2.6.32-431 or higher.
You can use uname -a to query the kernel version. The kernel version of the
blogger is 3.10.0-862. For convenience, the centos7 system is installed. If it is centos6, the kernel version needs to be upgraded, which is a little troublesome.
Docker has two There are two versions, Docker-ee and Docker-ce
Docker-ce is a community free version, Docker-ee is an enterprise version, which requires a fee. The installation in this article is the Docker-ce community free version
. Install the corresponding required package dependencies
downloads the yum source of docker-ce to/etc/yum.repos.d/
yum install docker-ce
docker installation is complete, start docker, check docker version information
Docker installed successfully.
3. Docker use.
run a hello-world container from the simplest hello-world. If there is no hello-world image locally, it will be automatically pulled from the remote docker hub
uses the docker images command to query the current image on the local host. There are a lot of other images on my machine. It is ok to see the hello-world image.
delete the image using the following command
Centos 7 Dockerfile Example
Pull the image from the remote docker hub
View Image to
view the list of local mirrors, and you can query the docker hub to pull the list of mirrors before successfully pulling the
first field of View Image is imagename (mirror name), and the fourth field is official, whether it is an official mirror or not. Individuals can also put the mirror they made on the docker hub and find the name of the mirror they want to download. got it.
Run a new container
Run a new container and call the print command
runs an interactive container (container)
can find that it has entered the container, exit and use exit or ctl+d to
pull a mirror image from the remote docker hub.
runs a new container in the background
View the details of the currently running container
View container port
can see that the port of container test1 is mapped to 32768 of the machine, and you can access port 32768 of the machine ip to view
View Image to
view container logs
stops specifying the container
Centos Dockerfile Example Online
can be used by running the container again
View the running process inside the specified container
View Image to
view historically launched containers
deletes the container, the container must be stopped
to add new tags to the image
Query container ip
Submit a copy of the container
I write so much first, and I will supplement it later
mentioned that you can upload your own local mirror to the docker hub, so how to generate your own mirror? Docker provides a docker file method to generate a local mirror, you can also use Use docker file to package your project into a mirror image.
4. Dockerfile part of the command
1. the prefix of each instruction must be capitalized
The dockerfile command actually has a lot of functions similar to the linux system itself, and it is relatively easy to understand. To facilitate understanding, the blogger made an example of packaging nginx service into a mirror and using it.
First of all, we need to put the nginx installation package and dockerfile we need to use in the same directory.
View Image to
create a Dockerfile file. In fact, the nginx installation process is written into a script, but it must conform to the dockerfile specification.
build mirror operation
Centos Dockerfile Example
Please note that the final surface has a point '.' , Dockerfile specified path can also be written as absolute path
execute successfully will appear
View local mirror you can see that we build mirrored
run-time image we build, map Go to the local 80 port
View Image to
view the local port 80
access the local 80 port, and the View Image is successful
Centos Dockerfile Example Code
Reprinted at: https://blog.51cto.com/13917261/2174203
Comments are closed.