kopia lustrzana https://github.com/jupyterhub/repo2docker
add chown to COPY commands to reduce layer count
rodzic
80b91eb169
commit
dc559b825a
|
@ -100,7 +100,7 @@ ENV PATH {{ ':'.join(path) }}:${PATH}
|
||||||
{% if build_script_files -%}
|
{% if build_script_files -%}
|
||||||
# If scripts required during build are present, copy them
|
# If scripts required during build are present, copy them
|
||||||
{% for src, dst in build_script_files|dictsort %}
|
{% for src, dst in build_script_files|dictsort %}
|
||||||
COPY {{ src }} {{ dst }}
|
COPY --chown=${NB_USER}:${NB_USER} {{ src }} {{ dst }}
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
||||||
|
@ -137,24 +137,16 @@ ENV {{item[0]}} {{item[1]}}
|
||||||
{% if preassemble_script_files -%}
|
{% if preassemble_script_files -%}
|
||||||
# If scripts required during build are present, copy them
|
# If scripts required during build are present, copy them
|
||||||
{% for src, dst in preassemble_script_files|dictsort %}
|
{% for src, dst in preassemble_script_files|dictsort %}
|
||||||
COPY src/{{ src }} ${REPO_DIR}/{{ dst }}
|
COPY --chown=${NB_USER}:${NB_USER} src/{{ src }} ${REPO_DIR}/{{ dst }}
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
||||||
{% if preassemble_script_directives -%}
|
|
||||||
USER root
|
|
||||||
RUN chown -R ${NB_USER}:${NB_USER} ${REPO_DIR}
|
|
||||||
{% endif -%}
|
|
||||||
|
|
||||||
{% for sd in preassemble_script_directives -%}
|
{% for sd in preassemble_script_directives -%}
|
||||||
{{ sd }}
|
{{ sd }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
# Copy and chown stuff. This doubles the size of the repo, because
|
# Copy stuff.
|
||||||
# you can't actually copy as USER, only as root! Thanks, Docker!
|
COPY --chown=${NB_USER}:${NB_USER} src/ ${REPO_DIR}
|
||||||
USER root
|
|
||||||
COPY src/ ${REPO_DIR}
|
|
||||||
RUN chown -R ${NB_USER}:${NB_USER} ${REPO_DIR}
|
|
||||||
|
|
||||||
# Run assemble scripts! These will actually turn the specification
|
# Run assemble scripts! These will actually turn the specification
|
||||||
# in the repository into an image.
|
# in the repository into an image.
|
||||||
|
|
Ładowanie…
Reference in New Issue