3.Ubuntu 16.04.6 离线安装 docker

准备

 

下载docker安装文件

https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/amd64/docker-ce_17.09.1~ce-0~ubuntu_amd64.deb

下载依赖文件

http://launchpadlibrarian.net/236916213/libltdl7_2.4.6-0.1_amd64.deb

 

开始

 

1.通过Xshell把这两个文件上传到Ubuntu服务器

 

 

2.验证文件是否已经上传

 

 

3.先安装依赖

sudo dpkg -i libltdl7_2.4.6-0.1_amd64.deb

 

4.安装docker程序

sudo dpkg -i docker-ce_17.09.1_ce-0_ubuntu_amd64.deb

 

5.查看安装结果

docker info

 

 

 

附:

如果已经安装过docker请先卸载再进行安装

1.1 打开Terminal,执行下面命令:

# sudo apt-get purge docker-ce

 

1.2 删除Docker安装目录

# sudo rm -rf /var/lib/docker

 

1.3 验证是否删除成功

# docker info

bash: /usr/bin/docker: No such file or directory

 

我们可以看到已经无法找到 docker 安装目录,证明卸载成功  

 

命令

Usage: docker COMMAND

A self-sufficient runtime for containers

Options:
--config string Location of client config files (default "/root/.docker") --客户端配置文件的位置
-D, --debug Enable debug mode --启用调试模式
--help Print usage --打印说明
-H, --host list Daemon socket(s) to connect to --要连接到的守护程序套接字
-l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info") --设置日志等级
--tls Use TLS; implied by --tlsverify
--tlscacert string Trust certs signed only by this CA (default "/root/.docker/ca.pem") --仅由此CA签名的信任证书
--tlscert string Path to TLS certificate file (default "/root/.docker/cert.pem") --TLS证书文件的字符串路径
--tlskey string Path to TLS key file (default "/root/.docker/key.pem") --TLS密钥文件的tls key字符串路径
--tlsverify Use TLS and verify the remote --TLS验证使用TLS并验证远程
-v, --version Print version information and quit --版本打印版本信息并退出

Management Commands:
config Manage Docker configs --配置管理Docker配置
container Manage containers --管理容器
image Manage images --管理镜像
network Manage networks --管理网络
node Manage Swarm nodes --管理群集节点
plugin Manage plugins --管理插件
secret Manage Docker secrets --管理加密
service Manage services --管理服务
stack Manage Docker stacks --管理Docker堆栈
swarm Manage Swarm --管理swarm
system Manage Docker --管理Docker
volume Manage volumes --管理卷

Commands:
attach Attach local standard input, output, and error streams to a running container --将本地标准输入、输出和错误流附加到正在运行的容器
build Build an image from a Dockerfile --从Dockerfile生成映像
commit Create a new image from a container's changes --提交从容器的更改创建新映像
cp Copy files/folders between a container and the local filesystem --在容器和本地文件系统之间复制文件/文件夹
create Create a new container --创建新容器
diff Inspect changes to files or directories on a container's filesystem --检查对容器文件系统上的文件或目录的更改
events Get real time events from the server --事件从服务器获取实时事件
exec Run a command in a running container --在正在运行的容器中运行命令
export Export a container's filesystem as a tar archive --将容器的文件系统导出为tar存档
history Show the history of an image --显示历史镜像
images List images 镜像列表
import Import the contents from a tarball to create a filesystem image --从tarball导入内容以创建文件系统镜像
info Display system-wide information --显示系统范围的信息
inspect Return low-level information on Docker objects --检查并返回Docker对象的低级信息
kill Kill one or more running containers --杀死一个或多个正在运行的容器
load Load an image from a tar archive or STDIN --从tar存档或STDIN加载图像
login Log in to a Docker registry --登录Docker仓库
logout Log out from a Docker registry --从Docker仓库注销
logs Fetch the logs of a container --获取容器的日志
pause Pause all processes within one or more containers --暂停一个或多个容器中的所有进程
port List port mappings or a specific mapping for the container --列表端口映射或容器的特定映射
ps List containers --容器列表
pull Pull an image or a repository from a registry --从仓库中提取镜像
push Push an image or a repository to a registry --将镜像推送到仓库
rename Rename a container --重命名容器
restart Restart one or more containers --重新启动一个或多个容器
rm Remove one or more containers --移除一个或多个容器
rmi Remove one or more images --删除一个或多个镜像
run Run a command in a new container --在新容器中运行命令
save Save one or more images to a tar archive (streamed to STDOUT by default) --将一个或多个镜像保存到tar存档(默认情况下流式传输到STDOUT)
search Search the Docker Hub for images --在Docker Hub中搜索镜像
start Start one or more stopped containers --启动一个或多个停止的容器
stats Display a live stream of container(s) resource usage statistics --stats显示容器资源使用统计的实时流
stop Stop one or more running containers --停止一个或多个正在运行的容器
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE --标记创建引用源图像的标记目标镜像
top Display the running processes of a container --顶部显示容器的运行进程
unpause Unpause all processes within one or more containers --取消暂停取消暂停一个或多个容器中的所有进程
update Update configuration of one or more containers --更新一个或多个容器的配置
version Show the Docker version information --版本显示Docker版本信息
wait Block until one or more containers stop, then print their exit codes --等待一个或多个容器停止,然后打印其出口代码

 

docker禁用交换分区 ,必须关闭

https://www.cnblogs.com/configure/p/13560307.html

一、不重启电脑,禁用启用swap,立刻生效,重启后需要重新设置

#禁用分区
# swapoff -a
#启用分区
# swapon -a
#查看交换分区的状态
# free -mh

二、重新启动电脑,永久禁用Swap

把根目录文件系统设为可读写

# mount -n -o remount,rw /

用vi修改 /etc/fstab 文件,在swap分区这行前加 # 禁用掉,保存退出

 

重启系统 

reboot
free -m

 

posted @ 2019-11-14 20:56  疯癫大圣  阅读(780)  评论(0编辑  收藏  举报