我的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上运行,但我需要从golang访问python脚本进行一些处理。如何在我的docker容器中安装python3并使用pip安装一些python依赖项。
发布于 2018-01-19 01:00:42
如果你确实在使用像这样的debian镜像:
这是标签:golang:1.9-stretch
Debian stretch已经在https://wiki.debian.org/Python中附带了python3
因此不需要进一步的操作。但是,您需要安装pip,然后照常继续。
发布于 2021-05-20 08:20:16
您可以通过在Dockerfile文件中添加以下行来在official golang docker image上安装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
https://stackoverflow.com/questions/48326309
复制相似问题