在docker中运行特定的ubuntu
我想使用具有特定ubuntu版本的docker。我的docker ubuntu图片如下:在docker中运行特定的ubuntu,ubuntu,docker,Ubuntu,Docker,我想使用具有特定ubuntu版本的docker。我的docker ubuntu图片如下: ubuntu@ubuntu:~$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE ubuntu latest dd6f76d9cc90 10 days ago 122MB ubu
ubuntu@ubuntu:~$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest dd6f76d9cc90 10 days ago 122MB
ubuntu 14.04 3aa18c7568fc 10 days ago 188MB
现在我想用ubuntu 14.04运行一个docker:
ubuntu@ubuntu:~$ docker run -it ubuntu:14.04
root@0b004c5dc55e:/# uname -a
Linux 0b004c5dc55e 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
当我用uname-a
检查它时,我看到仍然有Ubuntu-16.04
如何在docker中运行ubuntu的精确版本?它似乎运行得很好:
~/ docker run -it ubuntu:14.04
Unable to find image 'ubuntu:14.04' locally
14.04: Pulling from library/ubuntu
bae382666908: Pull complete
f1ddd5e846a8: Pull complete
90d12f864ab9: Pull complete
a57ea72e3176: Pull complete
783a14252520: Pull complete
Digest: sha256:f6eed4def93a3b54da920737f0abf1a8cae2e480bb368280c898265fcaf910a3
Status: Downloaded newer image for ubuntu:14.04
root@d91b2359e1b8:/# uname -a
Linux d91b2359e1b8 4.9.44-linuxkit-aufs #1 SMP Fri Aug 25 10:00:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
root@d91b2359e1b8:/# cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"
NAME="Ubuntu"
VERSION="14.04.5 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.5 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
root@d91b2359e1b8:/#
内核由主机在所有容器之间共享。要查看运行的版本,请使用:
cat/etc/*-release
它似乎运行良好:
~/ docker run -it ubuntu:14.04
Unable to find image 'ubuntu:14.04' locally
14.04: Pulling from library/ubuntu
bae382666908: Pull complete
f1ddd5e846a8: Pull complete
90d12f864ab9: Pull complete
a57ea72e3176: Pull complete
783a14252520: Pull complete
Digest: sha256:f6eed4def93a3b54da920737f0abf1a8cae2e480bb368280c898265fcaf910a3
Status: Downloaded newer image for ubuntu:14.04
root@d91b2359e1b8:/# uname -a
Linux d91b2359e1b8 4.9.44-linuxkit-aufs #1 SMP Fri Aug 25 10:00:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
root@d91b2359e1b8:/# cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"
NAME="Ubuntu"
VERSION="14.04.5 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.5 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
root@d91b2359e1b8:/#
内核由主机在所有容器之间共享。要查看运行的版本,请使用:
cat/etc/*-release
我认为uname会报告内核版本,该版本在容器和主机之间共享,您的输出是预期的
您可能希望查看此链接:
您也可能想考虑“CAT/ETC/Sood版本”
< P>我认为UnAsMess内核版本,它在容器和主机之间共享,并且您的输出是预期的。 您可能希望查看此链接:您也可能想考虑“CAT/ETC/SoalEffice发布”< /P>内核中可能复制的所有副本,可能是在所有容器之间从主机共享的。在容器中尝试发布文件是正确的方法。Thnanks@Matt会将其添加到我的答案中。内核由主机在所有容器之间共享。在容器中尝试发布文件是正确的方法。Thnanks@Matt会将其添加到我的答案中。
cat/etc/*release
most/formatcat/etc/*release
most/format