本文在win下使用docker 2,.3.0来安装ubuntu-18.04,boinic,之前使用过wsl 1 和wsl 2, 由于有些包需要内核的文件才能编译过去,而微软已修改过内核 (名字是4.19.84-microsoft-standard 这种形式),无法顺利编译。特自己使用原生的内核版本,构建了一个docker的unbut 18.04 镜像(Linux ad6cfa0a39b8 4.19.76-linuxkit #1 SMP Tue May 26 11:42:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux),并上传到hub.docker.com,方便大家拉取,具体操作和配置记录如下
找到镜像的标签https://hub.docker.com/_/ubuntu?tab=tags,
修改docker 拉取镜像的目录,
1. 创建容器
docker create --name myubuntu-boinic ubuntu:bionic-20200713
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
3ff22d22a855: Pull complete
e7cb79d19722: Pull complete
323d0d660b6a: Pull complete
b7f616834fd0: Pull complete
Digest: sha256:5d1d5407f353843ecf8b16524bc5565aa332e9e6a1297c73a92d3e754b8a636d
Status: Downloaded newer image for ubuntu:latest
810a4f7901204ae287fa57bb81d9bea40a044b69220f7e25a7691cdd03a522ba
2. 启动容器-0809,出错的话,注意修改时复制弄进去的空格(docker: Error response from daemon: Invalid container name (myubuntu18.04-0809 ), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed.)
docker run
--name="myubuntu-bionic" -it
ubuntu:bionic-20200713 /bin/bash
通过标签查看或者是删除镜像
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 1e4467b07108 2 weeks ago 73.9MB
docker rmi xxxx
docker ps -a
docker kill cb4958775df0
docker rmi
cb4958775df0
3. 容器中查看容器linux版本
要看容器系统的版本,命令:cat /etc/issue<