mirror of
https://github.com/Darkrock-Studios/hammer-editor.git
synced 2026-10-19 01:31:24 +00:00
Set file permissions correctly immediately (#799)
Some checks are pending
Build CI / iOS UI tests (push) Waiting to run
Build CI / build (push) Waiting to run
Build CI / static-analysis (push) Waiting to run
Build CI / android-instrumented-tests (push) Waiting to run
Build CI / iOS compile & test (push) Waiting to run
PublishInternal / publish-google-play (push) Waiting to run
Some checks are pending
Build CI / iOS UI tests (push) Waiting to run
Build CI / build (push) Waiting to run
Build CI / static-analysis (push) Waiting to run
Build CI / android-instrumented-tests (push) Waiting to run
Build CI / iOS compile & test (push) Waiting to run
PublishInternal / publish-google-play (push) Waiting to run
Perform the chown on the files copied into /opt/hammer during the COPY instruction, instead of during a separate RUN instruction. This prevents the files from being 'duplicated' due to having been changed on the layer for the RUN instruction. Effectively, this reduces the size of the layer for the RUN instruction from about 211 MB to approximately 0.
This commit is contained in:
parent
5acba72867
commit
ff8b278195
1 changed files with 2 additions and 2 deletions
|
|
@ -29,13 +29,13 @@ RUN groupadd --gid 1000 hammer \
|
|||
ENV SERVER_OPTS="-Duser.home=/data"
|
||||
|
||||
ARG DIST_DIR=server/build/install/server
|
||||
COPY ${DIST_DIR}/ /opt/hammer/
|
||||
COPY --chown=1000:1000 ${DIST_DIR}/ /opt/hammer/
|
||||
|
||||
# hammer_data itself must exist and be owned here: bind-mounting a config file
|
||||
# into it would otherwise have Docker create the parent as root, leaving the
|
||||
# unprivileged server unable to write pgdata.
|
||||
RUN mkdir -p /data/hammer_data \
|
||||
&& chown -R hammer:hammer /data /opt/hammer
|
||||
&& chown -R hammer:hammer /data
|
||||
|
||||
USER hammer
|
||||
WORKDIR /opt/hammer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue