无法在我的 Docker 容器中运行 Curl 命令 [英] Can't run Curl command inside my Docker Container

查看:173
本文介绍了无法在我的 Docker 容器中运行 Curl 命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从我的 OS X VM Docker 主机创建了一个 Docker 容器.我使用 run 命令创建了它,并基于 ubuntu:xenial docker hub 镜像创建了容器.

I created a docker container from my OS X VM Docker host. I created it using the run command and created the container based off the ubuntu:xenial image off docker hub.

在创建容器并以 root 用户身份在容器内的命令提示符下登录后,我现在已连接到容器.

I'm now connected to my container after it's created and logged in as root and at the command prompt inside my container.

我尝试安装 Homebrew,但由于某种原因,我无法运行安装 Homebrew 的命令:

I tried to install homebrew and for some reason, I can't run the command to install Homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

当我运行时,我得到了一个 bash:

when I run that I get a bash:

curl:找不到命令

不知道为什么我不能在我的容器内使用 curl.

Not sure why I'm not able to use curl here inside my container.

推荐答案

curl:找不到命令

curl: command not found

是一个很大的提示,你必须安装它:

is a big hint, you have to install it with :

apt-get update; apt-get install curl

这篇关于无法在我的 Docker 容器中运行 Curl 命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆