Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to parse the Docker container

2025-04-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Today, I will talk to you about how to parse the Docker container, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

1. Introduction

Docker is an open source application container engine that allows developers to package their applications and dependencies into a portable image, publish them to any popular Linux or Windows machine, and virtualize them. Containers are fully sandboxed and will not have any interface with each other. (Baidu Encyclopedia) Docker is one of the most popular technologies in 2014, and almost all programmers have heard of it. Docker is a "lightweight" container technology, which almost shakes the status of traditional virtualization technology. Now more and more companies at home and abroad have begun to use Docker to replace the existing virtualization platform.

Docker compares traditional virtual machines

Application scenario of Docker No. 8 Middle School

2. Installation

The specific requirements of CentOS are as follows: it must be a 64-bit operating system. It is recommended that the kernel be above 3.8.

1. Use the following command to view your CentOS kernel:

# uname-r

The output kernel version number is lower than 3.8. please upgrade the Linux kernel.

For CentOS 6.5, the kernel version defaults to 2.6. First, you can install the latest kernel with the following command:

Rpm-import https://www.elrepo.org/RPM-GPG-KEY-elrepo.orgrpm-ivh http://www.elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpmyum-y-enablerepo=elrepo-kernel install kernel-lt

2. Edit the following profile:

Vi / etc/grub.conf

Change default=1 to default=0.

Finally, restart the operating system with the reboot command.

3. Install Docker

Rpm-Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpmyum-y install docker-io

Check to see if Docker is installed successfully:

Docker version

Start the Docker service:

Service docker start

3 、 Docker command # docker search mysql find Mysql image # docker images display local existing image # docker ps view the status of the running container # docker pull mysql get a mysql image # docker run-t- I centos / bin/bash create a container # docker commit submit update copy

Create a mirror

# docker commit-m 'add json gem'-a' Docker Container' 7b789b1986d my/sintra:v2.0.1

Note the name of the repository of the maintainer information image, the name of the owner of the image, tag information

Use Dockerfile to create a mirror [no more than 127layers]

# mkdir centos# cd centos# vim Dockerfile

# comment

FROM centos # which image is used as the basis

MAINTAINER docker_user docker_user@email.com

RUN yum-qqy install ptyhon

# Note: to use yum, you need to set the parameter-qqy, otherwise an error will be reported.

Build an image

# docker build-tween centropins with extra python rides v1.0.1'.

Modify the label of the image

# docker tag 7b789b193355e my/container:v1

Import Mirror

# cat rarlinux-x64-5.3.0.tar.gz | docker import-rarlinux:5.3

Upload image

# docker push rarlinux [upload the image you created to the repository to share]

Save image [export]

# docker save-o centos.tar test/centos

Local image is imported into docker

# docker load-- input centos.tar.gz# docker load < centos.tar.gz

Delete Mirror

# docker rmi-f image_id (1245435467bd)

After reading the above, do you have any further understanding of how to parse the Docker container? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report