openvinotoolkit / docker_ci

The framework to generate a Dockerfile, build, test, and deploy a docker image with OpenVINO™ toolkit.
Apache License 2.0
59 stars 63 forks source link

a chain of `FROM xxx AS xxx` #289

Closed foxnight2 closed 1 year ago

foxnight2 commented 1 year ago

The dockerfile is very great. https://github.com/openvinotoolkit/docker_ci/blob/master/dockerfiles/ubuntu18/build_custom/Dockerfile

Start from line 79.
1. Why don't you use the dockerfile.fix method to build the docker image? Are the dockerfile.original and dockerfile.fix same step to build docker image? 2. What is the advantage of the dockerfile.original method (a chain of FROM xxx AS xxx)?

dockerfile.original

FROM ubuntu:18.04 AS copy_openvino
RUN cmd  (copy_openvino) ...

FROM copy_openvino AS openvino
RUN cmd  (openvino) ...

FROM openvino AS opencv
RUN cmd  (opencv) ...

FROM opencv as openvino_repo
RUN cmd  (openvino_repo) ...

dockerfile.fix comment the redundant FROM xxx AS xxx

FROM ubuntu:18.04 AS copy_openvino
RUN cmd  (copy_openvino) ...

# FROM copy_openvino AS openvino
RUN cmd  (openvino) ...

# FROM openvino AS opencv
RUN cmd  (opencv) ...

# FROM opencv as openvino_repo
RUN cmd  (openvino_repo) ...