Skip to content

Commit

Permalink
Use new COPY --chown flag
Browse files Browse the repository at this point in the history
Ever since moby/moby/pull/34263 became merged, there's no need to
shuffle users in order to get the correct ownership on non-root users
  • Loading branch information
aglorei committed Feb 2, 2018
1 parent db5915d commit ce52764
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,13 @@ RUN addgroup -S pokemaster && \
-h /pokemon_battle \
pokemaster

USER pokemaster
WORKDIR /pokemon_battle

COPY Gemfile* /pokemon_battle/
RUN chown -R pokemaster:pokemaster /pokemon_battle
USER pokemaster
COPY --chown=pokemaster:pokemaster Gemfile* /pokemon_battle/
RUN bundle install --deployment

USER root
COPY . /pokemon_battle
RUN chown -R pokemaster:pokemaster /pokemon_battle
COPY --chown=pokemaster:pokemaster . /pokemon_battle

USER pokemaster
ENTRYPOINT ["bundle", "exec"]
CMD ["rails", "server"]

0 comments on commit ce52764

Please sign in to comment.