linux下如何使用docker二进制文件安装

1,下载二进制文件

https://download.docker.com/linux/static/stable/x86_64/docker-18.03.1-ce.tgz

2,解压二进制文件

tar xzvf docker-18.03.1-ce.tgz

3,复制二进制文件到/usr/bin目录下

cp docker/* /usr/bin/

4,检查是否安装

docker version
Client:
Version:      18.03.1-ce
API version:  1.37
Go version:   go1.9.2
Git commit:   9ee9f40
Built:        Thu Apr 26 07:12:25 2018
OS/Arch:      linux/amd64
Experimental: false
Orchestrator: swarm

Server:
Engine:
Version:      18.03.1-ce
API version:  1.37 (minimum version 1.12)
Go version:   go1.9.5
Git commit:   9ee9f40
Built:        Thu Apr 26 07:23:03 2018
OS/Arch:      linux/amd64
Experimental: false

5,配置 docker.service文件

vi /usr/lib/systemd/system/docker.service

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
Type=notify
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=infinity
LimitNPROC=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s

[Install]
WantedBy=multi-user.target

6,启动dockerd服务进程

systemctl daemon-reload
systemctl start docker.service

7,检验

# ps aux|grep docker
root 2262 0.1 4.4 472948 44944 ? Ssl 16:38 0:00 /usr/bin/dockerd
root 2266 0.2 1.3 277032 13540 ? Ssl 16:38 0:01 docker-containerd --config /var/run/docker/containerd/containerd.toml
root 2895 0.0 0.0 112660 972 pts/0 S+ 16:48 0:00 grep --color=auto docker
# docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/

转载于:https://my.oschina.net/u/3585265/blog/3009100

Docker Compose是一个用于定义和运行多个Docker容器的工具,它可以通过一组配置文件来定义容器之间的关系和依赖关系。对于离线环境,你可以按照以下步骤进行Docker Compose的二进制文件安装: 1. 首先,你需要在一个有网络连接的机器上下载Docker Compose的二进制文件。你可以通过访问Docker官方的GitHub仓库来获取最新版本的二进制文件。在GitHub的release页面中,你可以找到适用于不同操作系统的二进制文件。 2. 在下载页面中,找到适用于你操作系统的二进制文件下载链接,并复制该链接地址。 3. 然后,将复制的链接地址粘贴到一个有网络连接的机器上,使用wget或curl等工具下载该二进制文件。例如,使用wget命令下载: ``` wget https://github.com/docker/compose/releases/download/{version}/docker-compose-{OS}-{ARCH} ``` 其中,{version}是Docker Compose的版本号,{OS}是操作系统名称(如linux、darwin等),{ARCH}是硬件架构(如x86_64、arm等)。 4. 下载完成后,将下载的二进制文件复制到目标离线环境中的机器上。 5. 在离线环境中,将二进制文件移动到合适的位置,并添加执行权限。例如,将二进制文件移动到/usr/local/bin目录,并添加执行权限: ``` sudo mv docker-compose /usr/local/bin/ sudo chmod +x /usr/local/bin/docker-compose ``` 6. 最后,验证安装是否成功,运行以下命令检查Docker Compose的版本: ``` docker-compose --version ``` 至此,你已经成功在离线环境中安装Docker Compose的二进制文件
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值