【发布时间】:2020-01-02 01:52:41
【问题描述】:
我有一个 python 应用程序,它的 docker build 大约需要 15-20 分钟。 以下是我的 Dockerfile 或多或少的样子
FROM ubuntu:18.04
...
COPY . /usr/local/app
RUN pip install -r /usr/local/app/requirements.txt
...
CMD ...
现在,如果我使用 skaffold,任何代码更改都会触发重建,并且它将重新安装所有要求(从 COPY 步骤开始,其他所有要求都将被重建),无论它们是否已经安装。 iIn docker-compose 这个问题将使用卷来解决。在 Kubernetes 中,如果我们按以下方式使用卷:
apiVersion: v1
kind: Pod
metadata:
name: test
spec:
containers:
- image: test:test
name: test-container
volumeMounts:
- mountPath: /usr/local/venv # this is the directory of the
# virtualenv of python
name: test-volume
volumes:
- name: test-volume
awsElasticBlockStore:
volumeID: <volume-id>
fsType: ext4
这个额外的需求构建会用 skaffold 解决吗?
【问题讨论】:
标签: kubernetes docker-compose docker-volume volumes skaffold