WSL中安装Docker

# step 0: clear# sudo apt-get remove docker docker-engine docker-ce docker.io

# step 1: 安装必要的一些系统工具sudo apt-get update#sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
# step 2: 安装GPG证书# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -    //官方
# curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -   //阿里云
# Step 3: 写入软件源信息# sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"  //官方
# sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"  //阿里云

# Step 4: 更新并安装Docker-CE
# sudo apt-get -y update
# sudo apt-get -y install docker-ce# 此处默认安装的是docker最新版本,但由于WSL的问题,可能会存在问题,会在拉取镜像的时候出现错误:Error response from daemon: OCI runtime create failed context canceled# 所以我们安装指定的docker版本,见4.1,我安装的是18.03.1-ce

# Step 4.1 安装指定版本的Docker-CE:
# Step 4.11: 查找Docker-CE的版本:
# apt-cache madison docker-ce
#   docker-ce | 17.03.1~ce-0~ubuntu-xenial | https://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial/stable amd64 Packages
#   docker-ce | 17.03.0~ce-0~ubuntu-xenial | https://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial/stable amd64 Packages
# Step 4.1.2: 安装指定版本的Docker-CE: (VERSION例如上面的17.03.1~ce-0~ubuntu-xenial)
# sudo apt-get -y install docker-ce=[VERSION]

# Step 5: 查看docker的版本# docker -v

# Step 6: 查看docker的启动状态# sudo service docker status

# Step 7:启动docker# sudo service docker start  //备注:WSL目前是WSL1,所以linux的发行版本部分命令还不能使用,比如systemctl命令。此处启动docker可以使用:sudo systemctl start docker

# Step 8:拉取hello-world镜像,验证docker是否正常# docker run hello-world# 输出:# Hello from Docker!# This message shows that your installation appears to be working correctly.# ......

参考:

https://yeasy.gitbooks.io/docker_practice/install/ubuntu.html

https://developer.aliyun.com/mirror/docker-ce?spm=a2c6h.13651102.0.0.3e221b11N33sKY

https://blog.csdn.net/u014418725/article/details/90733744

原文地址:https://www.cnblogs.com/talentzemin/p/12544273.html

时间: 2024-08-30 17:10:51

WSL中安装Docker的相关文章

在Ubuntu中安装Docker

前言 网上已经有很多介绍Docker安装的文章,自己的安装过程记录一下,为了博客文章结构的连贯性,为写下一篇R和Docker的相遇做为环境基础,同时也给自己一个备忘. 目录 Docker是什么? 在Linux Ubuntu中安装Docker Docker镜像仓库 制作自己的Docker镜像 上传Docker镜像到公共仓库 完整文章:http://blog.fens.me/linux-docker-install/

在Win7下利用VirtualBox和Vagrant中安装Docker

1.安装VirtualBox 和 Vagrant 首先下载安装VirtualBox 和 Vagrant的windows版本,两个都安装完成后,假设Vagrant在D:\HashiCorp\Vagrant目录下. 1.1 下载 cmd进入DOS,进入目录D:\HashiCorp\Vagrant\bin,一般标准命令是: To use the available boxes just replace {title} and {url} with the information in the tabl

在WSL中安装swool报错 error: unrecognized command line option '-V' 的解决方法

Windows Subsystem for Linux Ubuntu中使用pecl安装swool时遇到错误"error: C compiler cannot create executables"."error: unrecognized command line option '-V'" 解决方法 先看解决方法, 将gcc版本降低到4.8即可,因为高版本gcc取消了-V参数: sudo apt install gcc-4.8 -y sudo update-alte

在WSL中安装zsh终端

目录 在WSL中安装zsh终端 cmder中设置: 安装zsh和oh-my-zsh 安装类似fish shell的插件 zsh别名 参考: 在WSL中安装zsh终端 cmder中设置: 新增task,名称为wsl::bash,右下方的方框内填写: "%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl --distro-guid={f24dabf4-473d-4aa4-92

在Ubuntu中安装Docker和docker的使用

1.在Ubuntu中安装Docker 更新ubuntu的apt源索引 sudo apt-get update 安装包允许apt通过HTTPS使用仓库 sudo apt-get install apt-transport-https ca-certificates curl software-properties-common 添加Docker官方GPG key curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-k

Docker(一) - CentOS7中安装Docker - (视频教程)

Docker的使用越来越多,安装也相对简单.本文使用视频的方式展示在CentOS7系统中安装Docker,本文更适合于准备入门学习Docker的童靴. 以下视频,请带上耳机开始聆听 (双击全屏播放) 往期教程: .NET开发框架(一)-框架介绍与视频演示 .NET开发框架(二)-框架功能简述 .NET开发框架(三)-高可用服务器端设计 .NET开发框架(四)-服务器IIS实践教程 .NET开发框架(五)-IIS上部署ASP.NET Core项目教程 .NET开发框架(六)-架构设计之IIS负载均

Arch系Linux中安装Docker

Arch系Linux中安装Docker 1. 下载最新版docker $ sudo pacman -Syu docker 2. 免sudo执行docker $ sudo gpasswd -a ${USER} docker 需重启docker $ sudo systemctl restart docker 3. 配置docker国内镜像 在/etc/docker目录下新建daemon.json文件,写入下面内容(网易镜像) { "registry-mirrors": ["htt

学习docker系列-在centos6.5中安装docker

1.要求 centos6.5中需要64位 centos6.5的linux内核需要3.x(centos的内核是2.6) 2.查看当前系统的位数和版本 [[email protected] jacky]# uname -r 2.6.32-431.el6.x86_64 [[email protected] jacky]# cat /etc/issue CentOS release 6.5 (Final) Kernel \r on an \m 说明当前版本是centos6.5 64位系统 3. 安装yu

Centos7中安装Docker

1.配置docker镜像安装源 tee /etc/yum.repos.d/docker.repo <<-'EOF' [dockerrepo] name=Docker Repository baseurl=https://yum.dockerproject.org/repo/main/centos/7/ enabled=1 gpgcheck=1 gpgkey=https://yum.dockerproject.org/gpg EOF 4.安装docker yum install docker-e