Skip to content

Docker integration #288

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

Merged
merged 6 commits into from
Nov 29, 2016
Merged

Docker integration #288

merged 6 commits into from
Nov 29, 2016

Conversation

tboerger
Copy link
Member

To get a real docker container up and running I have updated the entire build process which integrates perfectly into our Drone environment. This will obsolete #125 and #117. Thank you guys for the work over there.

Thomas Boerger added 2 commits November 28, 2016 14:13
I have restructured the docker build process entirely, the binary gets
built outside of the docker build command, now we are managing all
dependencies with real Alpine packages and I have dropped features like
socat or the cron daemon.

Signed-off-by: Thomas Boerger <[email protected]>
In order to automatically build docker images I have re-enabled the
docker building parts within our drone runs on every push to master and
on every tag.

Signed-off-by: Thomas Boerger <[email protected]>
@tboerger tboerger added topic/deployment type/enhancement An improvement of existing functionality labels Nov 28, 2016
@tboerger tboerger added this to the 1.0.0 milestone Nov 28, 2016
This was referenced Nov 28, 2016
@leitzler
Copy link
Contributor

I'd strongly advice against running edge version of alpine too. latest is way better, but it shouldn't be used either. Go with 3.4 instead.

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

I'd strongly advice against running edge version of alpine too. latest is way better, but it shouldn't be used either. Go with 3.4 instead.

I'm running edge for MANY containers for a quite long time without any issue. gosu is only part of the testing repo, and shadow is only available in the edge community repo for now.

@willemvd
Copy link
Contributor

Will it also run as a non root user aka docker run -u ?

@stevenroose
Copy link

Is there a specific reason to use alpine:edge instead of just latest? I guess we want an environment as stable as possible to deploy Gitea in?

@tboerger
Copy link
Member Author

Is there a specific reason to use alpine:edge instead of just latest? I guess we want an environment as stable as possible to deploy Gitea in?

Yeah, gosu and shadow packages. I can just say that edge is pretty stable. You can see lots of containers at https://github.com/dockhippie, most of them are based on alpine:edge and they are used heavily and they are working without known issues.

@tboerger
Copy link
Member Author

Will it also run as a non root user aka docker run -u ?

I'm not sure if that is possible at all since daemons like openSSH are always started as root and it droppes the privileges later on.

@leitzler
Copy link
Contributor

edge is their development branch.. Or as they say on the wiki:

Warning: "edge" is under constant development so be careful using it in production. It is possible that bugs in "edge" could cause data loss or could break your system.

I'm sure it works for many users, but a stable product should never rely on an unspecified development version. I'm sure that this will be a deal breaker for users of Gitea.

You don't want latest either since they may release 4.0 any day and that one include breaking changes that propagate down to Gitea too.

@tboerger
Copy link
Member Author

So I have replaced gosu with the smaller su-exec now, I have replaced the shadow usage with addgroup and adduser and I have changed the base image to 3.4.

@metalmatze
Copy link
Contributor

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 Nov 28, 2016
Copy link
Member

@bkcsoft bkcsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few things

@@ -1,111 +0,0 @@
# Docker for Gogs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this file removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because multiple parts don't match anymore and instead of this file I would like to add a chapter to the docs and the example deployment repo.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

#!/bin/sh

for FOLDER in /data/gitea/conf /data/gitea/log /data/git /data/ssh; do
mkdir -p ${FOLDER}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be mkdir -p "${FOLDER}" || true no?

[bkc@bkc-ws] $ mkdir /usr
mkdir: cannot create directory ‘/usr’: File exists
[bkc@bkc-ws] $ echo $?
1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-p works fine like it is

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh nvm, I forgot to check with -p 😄

openssh \
tzdata && \
rm -rf \
/var/cache/apk/* && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why split short lines with few arguments?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say personal style/taste.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough! If you check out the most popular official images at Docker Hub, the usual way to split lines are per command (except for packages). In my opinion it adds readability, but as you say, it's a matter of style & taste.

@bkcsoft
Copy link
Member

bkcsoft commented Nov 29, 2016

LGTM

@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 Nov 29, 2016
@tboerger tboerger merged commit 16cdbe1 into go-gitea:master Nov 29, 2016
@tboerger tboerger deleted the docker branch November 29, 2016 10:42
@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/deployment type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants