docker部署

#将包导入,然后解压,安装

tar zxf docker.tar.gz

rpm -qa | grep runc

yum remove runc-1.1.0-2.el9.x86_64 #

dnf install *.rpm -y

#运行

root@localhost \~\]# systemctl enable --now docker Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service. #查看 \[root@docker \~\]# docker info Client: Docker Engine - Community Version: 27.1.2 Context: default Debug Mode: false Plugins: buildx: Docker Buildx (Docker Inc.) Version: v0.16.2 Path: /usr/libexec/docker/cli-plugins/docker-buildx compose: Docker Compose (Docker Inc.) Version: v2.29.1 Path: /usr/libexec/docker/cli-plugins/docker-compose ...... #初识镜像 \[root@docker \~\]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE \[root@docker \~\]# docker pull busybox ##拉取镜像 阿里云,镜像加速器? \[root@docker docker\]# vim daemon.json \[root@docker docker\]# cat daemon.json { "registry-mirrors": \["https://sz947zpr.mirror.aliyuncs.com"

}

root@docker \~\]# systemctl restart docker \[root@docker \~\]# docker search nginx ##可以使用这个命令搜索 NAME DESCRIPTION STARS OFFICIAL nginx Official build of Nginx. 20126 \[OK

nginx/nginx-quic-qns NGINX QUIC interop 1

nginx/nginx-ingress NGINX and NGINX Plus Ingress Controllers fo... 94

nginx/nginx-ingress-operator NGINX Ingress Operator for NGINX and NGINX P... 2

nginx/nginx-prometheus-exporter NGINX Prometheus Exporter for NGINX and NGIN... 43

#将本地下载的导入

root@docker \~\]# docker load -i game2048.tar.gz 011b303988d2: Loading layer \[==================================================\>\] 5.05MB/5.05MB 36e9226e74f8: Loading layer \[==================================================\>\] 51.46MB/51.46MB 192e9fad2abc: Loading layer \[==================================================\>\] 3.584kB/3.584kB 6d7504772167: Loading layer \[==================================================\>\] 4.608kB/4.608kB 88fca8ae768a: Loading layer \[==================================================\>\] 629.8kB/629.8kB Loaded image: timinglee/game2048:latest \[root@docker \~\]# docker load -i mario.tar.gz \[root@docker \~\]# docker load -i nginx-latest.tar.gz \[root@docker \~\]# docker load -i busybox-latest.tar.gz \[root@docker \~\]# docker images #查看镜像 REPOSITORY TAG IMAGE ID CREATED SIZE nginx latest 5ef79149e0ec 13 days ago 188MB busybox latest 65ad0d468eb1 15 months ago 4.26MB timinglee/game2048 latest 19299002fdbe 7 years ago 55.5MB timinglee/mario latest 9a35a9e43e8c 8 years ago 198MB \[root@docker \~\]# docker run -d --rm --name webserver -p 80:80 nginx #运行容器 621074a73599f9ec4596c88d42377edad7c0a7024415556a1828b66ba2043988 \[root@docker \~\]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 621074a73599 nginx "/docker-entrypoint...." 29 seconds ago Up 28 seconds 0.0.0.0:80-\>80/tcp, :::80-\>80/tcp webserver ![](https://i-blog.csdnimg.cn/direct/0acbb812ea8549d6b5de86c28a4f4b1f.png) \[root@docker \~\]# docker rm -f webserver webserver \[root@docker \~\]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES \[root@docker \~\]# \[root@docker \~\]# docker run -d --rm --name game1 -p 80:80 timinglee/game2048:latest ebaa6f672eba033c75e935e48fcf5ce4bb2f023c400b9ccfb44420ded0f86406 \[root@docker \~\]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ebaa6f672eba timinglee/game2048:latest "/bin/sh -c 'sed -i ..." About a minute ago Up About a minute 0.0.0.0:80-\>80/tcp, :::80-\>80/tcp, 443/tcp game1 \[root@docker \~\]# docker history timinglee/game2048:latest IMAGE CREATED CREATED BY SIZE COMMENT 19299002fdbe 7 years ago /bin/sh -c #(nop) CMD \["/bin/sh" "-c" "sed ... 0B \ 7 years ago /bin/sh -c #(nop) EXPOSE 80/tcp 0B \ 7 years ago /bin/sh -c #(nop) COPY dir:cb74e9c037a3d501c... 600kB \ 7 years ago /bin/sh -c #(nop) MAINTAINER Golfen Guo \ 7 years ago /bin/sh -c #(nop) CMD \["nginx" "-g" "daemon... 0B \ 7 years ago /bin/sh -c #(nop) EXPOSE 443/tcp 80/tcp 0B \ 7 years ago /bin/sh -c #(nop) COPY file:d15ceb73c6ea776c... 1.1kB \ 7 years ago /bin/sh -c #(nop) COPY file:af94db45bb7e4b8f... 643B \ 7 years ago /bin/sh -c GPG_KEYS=B0F4253373F8F6F510D42178... 50.1MB \ 7 years ago /bin/sh -c #(nop) ENV NGINX_VERSION=1.11.7 0B \ 7 years ago /bin/sh -c #(nop) MAINTAINER NGINX Docker M... 0B \ 7 years ago /bin/sh -c #(nop) ADD file:7afbc23fda8b0b387... 4.8MB ![](https://i-blog.csdnimg.cn/direct/3c39befab95542159077e12ef7b609ba.png) \[root@docker \~\]# docker rm -f game1 game1 \[root@docker \~\]# docker run -d --rm --name maliao -p 80:8080 timinglee/mario:latest 7060b40db90e9ed77ad8ebfa401518459d46c4066b8ea3443aaaf41f1a6ef60e \[root@docker \~\]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7060b40db90e timinglee/mario:latest "python3 -m http.ser..." 4 seconds ago Up 3 seconds 0.0.0.0:80-\>8080/tcp, :::80-\>8080/tcp maliao ![](https://i-blog.csdnimg.cn/direct/ec7a0774c4784ab78f9ade804447add1.png)

相关推荐
sauTCc8 小时前
Docker初探
docker
宁zz8 小时前
乌班图安装jenkins
运维·jenkins
云上艺旅8 小时前
K8S学习之基础七十四:部署在线书店bookinfo
学习·云原生·容器·kubernetes
c无序8 小时前
【Docker-7】Docker是什么+Docker版本+Docker架构+Docker生态
docker·容器·架构
FixBug_Nick8 小时前
使用Docker安装及使用最新版本的Jenkins
docker·容器·jenkins
大丈夫立于天地间8 小时前
ISIS协议中的数据库同步
运维·网络·信息与通信
rainFFrain9 小时前
单例模式与线程安全
linux·运维·服务器·vscode·单例模式
ghostwritten10 小时前
Run Milvus in Kubernetes with Milvus Operator
容器·kubernetes·milvus
Zero_to_zero123411 小时前
解决docker的ubuntu系统中文乱码问题
ubuntu·docker·容器
@郭小茶11 小时前
docker-compose方式部署docker项目
运维·docker·容器