例如,如果您要为Django项目创建容器,那么远程解释器是存储在Docker云中而不是存储在PC上的python解释器吗?
因此,当有人在另一台PC上运行容器时,它将使用Docker云中为此项目指定的同一远程解释器吗?
答案 0 :(得分:1)
您的docker docker容器就像一个包含python解释器+ django源代码+其他内容的盒子。
因此,当您使用Django应用程序制作Docker容器时,显然会有一个Dockerfile看起来像这样:
library(ggplot2)
df <- data.frame(group = rep(c("A", "B"), each = 20),
y = c(sample(1:90, 20, replace = TRUE),
sample(1:30, 20, replace = TRUE)),
x = rep(1:20, 2)
)
ggplot(df, aes(x = x, y = y, color = group))+
geom_line()+
labs(x = "", y = "", title = "Comparison",
subtitle = "Unit (thousand)",
caption = "Source: Kaggle")+
theme(legend.title = element_blank(),
legend.position = "top",
legend.justification='left',
legend.box = "horizontal",
legend.key = element_blank(),
legend.box.margin = margin(-1,0,0,-2,"cm"),
plot.margin = unit(c(0, 0, 0, 2), "cm"),
plot.title = element_text(hjust = 0.2),
plot.subtitle = element_text(hjust = 0.2),
plot.caption.position = "plot",
plot.caption = element_text(hjust = 0)
)
和FROM python:3.8.0-alpine
# set work directory
WORKDIR /usr/src/app
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# install dependencies
RUN pip install --upgrade pip
COPY ./requirements.txt /usr/src/app/requirements.txt
RUN pip install -r requirements.txt
# copy project
COPY . /usr/src/app/
版本:“ 3.7”
docker-compose.yml
因此,当有人在另一台PC上运行该容器时,它将使用该容器中的同一本地解释器。