Get the App
SLTechnology News&Howtos  ›  Servers  › 

How docker creates containers

Shulou Source: shulou.com Published: 2022-05-31 20:13:59 11月16日 Update

This article will explain in detail how to create containers for docker. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

After the docker is fully installed

Running

Docker pull ubuntu:latest

You may encounter

FATA [0015] Tag lastest not found in repository ubuntu

It is possible that the network is not working. Try a few more times and you will OK. An environment with the latest ubuntu installed with almost everything in it

Ubuntu 、 Fedora 、 Postgresql 、 MySQL 、 Jenkins 、 Elasticsearch 、 Redis

Run the environment

Docker run-- rm-ti ubuntu / bin/bash

-- rm: tells Docker to delete the container as soon as the running process exits. This is very useful in testing to avoid clutter [picture]

-ti: tells Docker to assign a pseudo terminal and enter interactive mode. This will enter the container, which is useful for rapid prototyping or experimentation, but do not open these logos in the production container [picture]

Ubuntu: this is the image of the container based on [picture]

/ bin/bash: the command to run, since we started it in interactive mode, it will display a prompt for a container

Run a docker container in the background

Docker rum-d ubuntu ping 8.8.8.8

Will output a randomly assigned ID

Then enter

Docker ps

To check out

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESfa6794f1ba1d ubuntu:14.04 "ping 8.8.8.8" 14 seconds ago Up 12 seconds tender_payne

Use the command to see what is going on in the container

This is the end of the docker exec-ti tender_payne / bin/bash article on "how to create containers for docker". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Tags: Container run picture article command more useful pattern environment allocation good practical cluttered stuff content prototype background prompt article logo Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Apple Microsoft Shulou Technology MariaDB