Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Dockerfile #1632

Merged
merged 1 commit into from
Apr 29, 2017
Merged

Refactor Dockerfile #1632

merged 1 commit into from
Apr 29, 2017

Conversation

PeterDaveHello
Copy link
Contributor

  1. Use apk -U add instead of apk update + apk add
  2. Separate package installation and user, group setup, the combination
    to reduce a docker image layer didn't bring benefits here.

@cez81
Copy link
Contributor

cez81 commented Apr 28, 2017

Maybe sync this with #1615

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 28, 2017
@sapk
Copy link
Member

sapk commented Apr 28, 2017

I was planning and updating and cleaning Dockerfile for alpine part, following https://github.com/gliderlabs/docker-alpine/blob/master/docs/usage.md, for example adding also --no-cache instead of rm -rf /var/cache/apk/*. Has you like this could be merged before #1615 because in this PR I will add multi-arch source (FROM) and multi-stage to have one Dockerfile for every platform and this need time to do it ^^.

@PeterDaveHello
Copy link
Contributor Author

Okay, just to confirm, so what I need to do here is to use --no-cache instead of manually cache cleaning and @sapk you'll do the multiarch part? Thanks.

@sapk
Copy link
Member

sapk commented Apr 28, 2017

Please add --no-cache and I will L-G-T-M since my change need a function not yet implemented in stable release of docker.

I would also prefer to not add a stage by splitting RUN instruction and keep it together.

@PeterDaveHello
Copy link
Contributor Author

What's the reason why here to combine two unrelated things into a single layer? I didn't see a good point here.

1. Use `apk -U --no-cache add` instead of `apk update` + `apk add` +
manually cache clean up.
2. Separate package installation and user, group setup, the combination
to reduce a docker image layer didn't bring benefits here, only makes
Dockerfiles more complex.
@bkcsoft
Copy link
Member

bkcsoft commented Apr 29, 2017

I'm fine with this change. Concatenating the layers only makes sense if we're removing build-deps in the end. LGTM

@tboerger tboerger added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 29, 2017
@sapk
Copy link
Member

sapk commented Apr 29, 2017

LGTM
For multiple RUN/layer, I tend to keep things together but I am not enforcing it ^^

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 29, 2017
@sapk
Copy link
Member

sapk commented Apr 29, 2017

Oh I forget the -U is useless with --no-cache but this could also be merged with it.

@bkcsoft bkcsoft merged commit 1562e9a into go-gitea:master Apr 29, 2017
@lunny lunny added this to the 1.2.0 milestone Apr 30, 2017
@lunny lunny added the topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile label Apr 30, 2017
@PeterDaveHello PeterDaveHello deleted the Dockerfile branch April 30, 2017 08:23
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants