File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change 100100{% if build_script_files -%}
101101# If scripts required during build are present, copy them
102102{% for src, dst in build_script_files|dictsort %}
103- COPY {{ src }} {{ dst }}
103+ COPY --chown=${NB_USER}:${NB_USER} {{ src }} {{ dst }}
104104{% endfor -%}
105105{% endif -%}
106106
137137{% if preassemble_script_files -%}
138138# If scripts required during build are present, copy them
139139{% for src, dst in preassemble_script_files|dictsort %}
140- COPY src/{{ src }} ${REPO_DIR}/{{ dst }}
140+ COPY --chown=${NB_USER}:${NB_USER} src/{{ src }} ${REPO_DIR}/{{ dst }}
141141{% endfor -%}
142142{% endif -%}
143143
144- {% if preassemble_script_directives -%}
145- USER root
146- RUN chown -R ${NB_USER}:${NB_USER} ${REPO_DIR}
147- {% endif -%}
148-
149144{% for sd in preassemble_script_directives -%}
150145{{ sd }}
151146{% endfor %}
152147
153- # Copy and chown stuff. This doubles the size of the repo, because
154- # you can't actually copy as USER, only as root! Thanks, Docker!
155- USER root
156- COPY src/ ${REPO_DIR}
157- RUN chown -R ${NB_USER}:${NB_USER} ${REPO_DIR}
148+ # Copy stuff.
149+ COPY --chown=${NB_USER}:${NB_USER} src/ ${REPO_DIR}
158150
159151# Run assemble scripts! These will actually turn the specification
160152# in the repository into an image.
You can’t perform that action at this time.
0 commit comments