我试图在Ubuntu容器中下载Debian软件包,如下所示:
sudo docker run ubuntu:14.04 wget https://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.8.2-omnibus.1-1_amd64.deb
我得到
exec: "wget": executable file not found in $PATH
我已经安装了Docker的wget,如下所示:
run ubuntu:14.04 apt-get install wget
如何下载文件?
您需要先安装它。创建一个新的Dockerfile,并在其中安装wget:
FROM ubuntu:14.04 RUN apt-get update \ && apt-get install -y wget \ && rm -rf /var/lib/apt/lists/*
然后,构建该图像:
docker build -t my-ubuntu .
最后运行它:
docker run my-ubuntu wget https://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.8.2-omnibus.1-1_amd64.deb