在AWS EC2的实例(Ubuntu)里面安装docker时,使用通常的安装步骤
:~$ sudo apt-get update :~$ sudo apt-get install docker
安装完成之后,查看docker版本时,提示docker命令不存在
:~$ sudo docker -v sudo: docker: command not found
在stack overflow上看人说,使用apt-get 安装的是一个GUI应用程序,而不是我们要使用的开发工具。通过运行如下脚本来安装docker
sudo curl -sSL https://get.docker.com/ | sh
在安装完成后,要注意下面的提示:
WARNING: Adding a user to the "docker" group will grant the ability to run containers which can be used to obtain root privileges on the docker host. Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface for more information.
然后更新docker run命令
sudo apt-get update && apt-get upgrade
最后,查看docker版本:
:~$ sudo docker --version Docker version 1.13.1, build 092cba3
说明docker已经安装成功
参考:
ubuntu 14.04 - docker command not found even though installed with apt-get - Stack Overflowhttps://stackoverflow.com/questions/30379381/docker-command-not-found-even-though-installed-with-apt-get
原文地址:https://www.cnblogs.com/wujing-hubei/p/8616211.html
时间: 2024-10-02 04:41:15