我需要同时访问同一容器中的pipenv
和FROM python:3.7
COPY Pipfile /app/Pipfile
RUN pip install pipenv
FROM node:8
npm install
。我认为实现此目标的最佳方法是使用多阶段构建。
如果我做这样的事情:
pipenv
如何确保不丢弃Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 4 And Target.Row = 4 Then
Target.Offset(10, 3) = Format(Now(), "YYYY-MM-DD HH:MM:SS")
End If
End Sub
二进制文件?我需要从上一阶段复制哪些文件,以便最终图像中可以使用pipenv?
答案 0 :(得分:2)
多阶段构建。从基本映像python:3.7
开始并在其中安装节点,将是简单的解决方案
FROM python:3.7
COPY Pipfile /app/Pipfile
RUN pip install pipenv
# Using Debian, as root
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash -
RUN apt-get install -y nodejs
$ docker run -ti --rm python:3.7 bash
root@eb654212ef67:/# cat /etc/*release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
root@eb654212ef67:/#
https://github.com/nodesource/distributions/blob/master/README.md
Node.js v11.x:
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_11.x | bash -
apt-get install -y nodejs
Node.js v10.x:
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get install -y nodejs
Node.js v8.x:
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get install -y nodejs