-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[WIP] Multi-stage (& multi-arch) dockerfile #1615
Closed
Closed
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
c8c5bab
Prepare migration to multi-stage dokcerfile + add support for multi-a…
sapk 8596126
Add management of docker manifest + base manisfest on gitea
sapk 09da0ea
Add docker-multi-update-all and use GITEA_VERSION
sapk 276ab45
Allow more flexible config
sapk a242fb5
fix and improve
sapk 617234d
De-duplicate
sapk 942da85
Add DOCKER_PUSHIMAGE config env to docker-multi-update-manifest
sapk e4a7fae
Use docker login folder
sapk c8de80a
REmove useless "
sapk f374195
Use vX.X.X like git tags
sapk 6299ecd
set docker-multi-push under env params
sapk da400ba
some fixes
sapk 26a669b
Use gitea/gitea- to have allways format gitea/gitea*
sapk 42f6b25
Use gitea/gitea- to have allways format gitea/gitea* as base
sapk 3d726d7
Delete Dockerfile.aarch64
sapk 3401ee0
Delete Dockerfile
sapk 6e672a8
Delete Dockerfile.rpi
sapk 1b98be6
Rename Dockerfile.multi to Dockerfile
sapk f1738a7
Update Makefile
sapk 57f68e9
Update Makefile
sapk d2f9ae8
Update Makefile
sapk 3fc4708
Enforce netgo at build stage
sapk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,44 @@ | ||
FROM alpine:3.5 | ||
MAINTAINER Thomas Boerger <thomas@webhippie.de> | ||
################################### | ||
#Build stage | ||
FROM gitea/gitea-base AS build-env | ||
|
||
ARG TAGS="sqlite" | ||
ENV TAGS "bindata netgo $TAGS" | ||
ENV GOPATH /go/ | ||
ENV PATH "${PATH}:${GOPATH}/bin" | ||
|
||
RUN apk --no-cache add go git build-base | ||
|
||
ADD . ${GOPATH}/src/code.gitea.io/gitea | ||
WORKDIR ${GOPATH}/src/code.gitea.io/gitea | ||
|
||
ARG GITEA_VERSION | ||
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout ${GITEA_VERSION}; fi \ | ||
&& make clean generate build | ||
|
||
################################### | ||
#Run stage | ||
FROM gitea/gitea-base | ||
LABEL maintainer "Thomas Boerger <thomas@webhippie.de>" | ||
|
||
ARG UID=1000 | ||
ARG GID=1000 | ||
|
||
EXPOSE 22 3000 | ||
|
||
RUN apk --no-cache add \ | ||
su-exec \ | ||
ca-certificates \ | ||
sqlite \ | ||
bash \ | ||
git \ | ||
linux-pam \ | ||
s6 \ | ||
curl \ | ||
openssh \ | ||
tzdata | ||
RUN addgroup \ | ||
-S -g 1000 \ | ||
git && \ | ||
adduser \ | ||
-S -H -D \ | ||
-h /data/git \ | ||
-s /bin/bash \ | ||
-u 1000 \ | ||
-G git \ | ||
git && \ | ||
echo "git:$(date +%s | sha256sum | base64 | head -c 32)" | chpasswd | ||
su-exec ca-certificates sqlite bash git linux-pam s6 curl openssh tzdata \ | ||
&& addgroup -S -g ${GID} git \ | ||
&& adduser -S -H -D -h /data/git -s /bin/bash -u ${UID} -G git git \ | ||
&& echo "git:$(dd if=/dev/urandom bs=24 count=1 | base64)" | chpasswd | ||
|
||
ENV USER git | ||
ENV GITEA_CUSTOM /data/gitea | ||
ENV GODEBUG=netdns=go | ||
|
||
VOLUME ["/data"] | ||
|
||
ENTRYPOINT ["/usr/bin/entrypoint"] | ||
CMD ["/bin/s6-svscan", "/etc/s6"] | ||
|
||
COPY docker / | ||
COPY gitea /app/gitea/gitea | ||
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
image: gitea/gitea-base:latest | ||
manifests: | ||
- image: alpine:latest | ||
platform: | ||
architecture: amd64 | ||
os: linux | ||
- image: multiarch/alpine:armhf-latest-stable | ||
platform: | ||
architecture: arm | ||
os: linux | ||
- image: multiarch/alpine:aarch64-latest-stable | ||
platform: | ||
architecture: arm64 | ||
os: linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
image: gitea/gitea:v1.0.0 | ||
manifests: | ||
- image: gitea/gitea:linux-amd64-v1.0.0 | ||
platform: | ||
architecture: amd64 | ||
os: linux | ||
- image: gitea/gitea:linux-arm-v1.0.0 | ||
platform: | ||
architecture: arm | ||
os: linux | ||
- image: gitea/gitea:linux-arm64-v1.0.0 | ||
platform: | ||
architecture: arm64 | ||
os: linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
image: gitea/gitea:v1.0.1 | ||
manifests: | ||
- image: gitea/gitea:linux-amd64-v1.0.1 | ||
platform: | ||
architecture: amd64 | ||
os: linux | ||
- image: gitea/gitea:linux-arm-v1.0.1 | ||
platform: | ||
architecture: arm | ||
os: linux | ||
- image: gitea/gitea:linux-arm64-v1.0.1 | ||
platform: | ||
architecture: arm64 | ||
os: linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
image: gitea/gitea:v1.0.2 | ||
manifests: | ||
- image: gitea/gitea:linux-amd64-v1.0.2 | ||
platform: | ||
architecture: amd64 | ||
os: linux | ||
- image: gitea/gitea:linux-arm-v1.0.2 | ||
platform: | ||
architecture: arm | ||
os: linux | ||
- image: gitea/gitea:linux-arm64-v1.0.2 | ||
platform: | ||
architecture: arm64 | ||
os: linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
image: gitea/gitea:v1.0 | ||
manifests: | ||
- image: gitea/gitea:linux-amd64-v1.0.2 | ||
platform: | ||
architecture: amd64 | ||
os: linux | ||
- image: gitea/gitea:linux-arm-v1.0.2 | ||
platform: | ||
architecture: arm | ||
os: linux | ||
- image: gitea/gitea:linux-arm64-v1.0.2 | ||
platform: | ||
architecture: arm64 | ||
os: linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
image: gitea/gitea:v1.1.0 | ||
manifests: | ||
- image: gitea/gitea:linux-amd64-v1.1.0 | ||
platform: | ||
architecture: amd64 | ||
os: linux | ||
- image: gitea/gitea:linux-arm-v1.1.0 | ||
platform: | ||
architecture: arm | ||
os: linux | ||
- image: gitea/gitea:linux-arm64-v1.1.0 | ||
platform: | ||
architecture: arm64 | ||
os: linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
image: gitea/gitea:v1.1.1 | ||
manifests: | ||
- image: gitea/gitea:linux-amd64-v1.1.1 | ||
platform: | ||
architecture: amd64 | ||
os: linux | ||
- image: gitea/gitea:linux-arm-v1.1.1 | ||
platform: | ||
architecture: arm | ||
os: linux | ||
- image: gitea/gitea:linux-arm64-v1.1.1 | ||
platform: | ||
architecture: arm64 | ||
os: linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
image: gitea/gitea:v1.1 | ||
manifests: | ||
- image: gitea/gitea:linux-amd64-v1.1.1 | ||
platform: | ||
architecture: amd64 | ||
os: linux | ||
- image: gitea/gitea:linux-arm-v1.1.1 | ||
platform: | ||
architecture: arm | ||
os: linux | ||
- image: gitea/gitea:linux-arm64-v1.1.1 | ||
platform: | ||
architecture: arm64 | ||
os: linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
image: gitea/gitea:latest | ||
manifests: | ||
- image: gitea/gitea:linux-amd64-master | ||
platform: | ||
architecture: amd64 | ||
os: linux | ||
- image: gitea/gitea:linux-arm-master | ||
platform: | ||
architecture: arm | ||
os: linux | ||
- image: gitea/gitea:linux-arm64-master | ||
platform: | ||
architecture: arm64 | ||
os: linux |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder to myself : Check if this is usefull since this still run with root after.