My docker file looks something like this:
# 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/...
My base application will be running on golang,but I need to access a python script from golang for some processing. How do I install python3 in my docker container and install some of python dependencies using pip .
If you're indeed using a debian image like this one:
Which is tag: golang:1.9-stretch
Debian stretch comes with python3 already https://wiki.debian.org/Python
So no further action is required. You would need to install pip however and then continue as normal.
You can install python3 on official golang docker image by adding following lines to your Dockerfile:
RUN apt-get update
RUN apt-get -y install python3
RUN apt-get -y install python3-setuptools
RUN apt-get -y install python3-pip
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.