如何在docker中以golang作为基本映像安装python3?
我的docker文件如下所示:如何在docker中以golang作为基本映像安装python3?,python,docker,docker-compose,Python,Docker,Docker Compose,我的docker文件如下所示: # Start from a Debian image with the latest version of Go installed # and a workspace (GOPATH) configured at /go. FROM golang # Install our Go dependencies RUN go get -u golang.org/x/oauth2... ENTRYPOINT /go/bin/... 我的基础应用程序将在golang
# Start from a Debian image with the latest version of Go installed
# and a workspace (GOPATH) configured at /go.
FROM golang
# Install our Go dependencies
RUN go get -u golang.org/x/oauth2...
ENTRYPOINT /go/bin/...
我的基础应用程序将在golang上运行,但我需要从golang访问python脚本进行一些处理。如何在docker容器中安装python3,并使用pip安装一些python依赖项。如果您确实在使用像这样的debian映像: 这是标签:
golang:1.9-stretch
Debian stretch已经提供了Python 3
因此,无需采取进一步行动。但是,您需要安装pip,然后继续正常操作。您可以通过在Dockerfile中添加以下行来安装python3:
RUN apt-get update
RUN apt-get -y install python3
RUN apt-get -y install python3-setuptools
RUN apt-get -y install python3-pip
我试过这个图像
python3
生成/bin/sh:1:python3:未找到