-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[WIP] Feature/docker updates #125
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
FROM alpine:3.3 | ||
MAINTAINER [email protected] | ||
FROM alpine:3.4 | ||
|
||
# Install system utils & Gogs runtime dependencies | ||
MAINTAINER Rachid Zarouali <[email protected]> | ||
|
||
# Install system utils & gitea runtime dependencies | ||
ADD https://github.com/tianon/gosu/releases/download/1.9/gosu-amd64 /usr/sbin/gosu | ||
RUN chmod +x /usr/sbin/gosu \ | ||
&& apk --no-cache --no-progress add ca-certificates bash git linux-pam s6 curl openssh socat tzdata | ||
|
||
ENV GITEA_CUSTOM /data/gogs | ||
ENV GITEA_CUSTOM /data/gitea | ||
|
||
COPY . /app/gogs/ | ||
WORKDIR /app/gogs/ | ||
RUN ./docker/build.sh | ||
COPY . /app/gitea/ | ||
WORKDIR /app/gitea/ | ||
|
||
# Configure LibC Name Service | ||
COPY docker/nsswitch.conf /etc/nsswitch.conf | ||
|
||
# creating data folder tree | ||
RUN mkdir -p /data/gitea/data /data/gitea/conf /data/gitea/log /data/git /data/ssh | ||
|
||
# Configure Docker Container | ||
VOLUME ["/data"] | ||
EXPOSE 22 3000 | ||
ENTRYPOINT ["docker/start.sh"] | ||
CMD ["/bin/s6-svscan", "/app/gogs/docker/s6/"] | ||
CMD ["/bin/s6-svscan", "/app/gitea/docker/s6/"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,11 @@ | |
[](http://microbadger.com/images/gitea/gitea "Get your own image badge on microbadger.com") | ||
[](https://gitter.im/go-gitea/gitea?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
|
||
 | ||
 | ||
|
||
##### Current tip version: 0.9.99 (see [Releases](https://github.com/go-gitea/gitea/releases) for binary versions or submit a task on [alpha stage automated binary building system](https://build.gogs.io/)) | ||
##### Status | ||
|
||
**Current version: 1.0.0** (see [Releases](https://github.com/go-gitea/gitea/releases)) | ||
|
||
| Web | UI | Preview | | ||
|:-------------:|:-------:|:-------:| | ||
|
@@ -19,25 +21,14 @@ | |
|
||
### Important Notes | ||
|
||
1. **YOU MUST READ [Contributing Code](https://github.com/go-gitea/gitea/wiki/Contributing-Code) BEFORE STARTING TO WORK ON A PULL REQUEST**. | ||
2. Due to testing purpose, data of [try.gogs.io](https://try.gogs.io) was reset in **Jan 28, 2015** and will reset multiple times after. Please do **NOT** put your important data on the site. | ||
3. The demo site [try.gogs.io](https://try.gogs.io) is running under `develop` branch. | ||
4. If you think there are vulnerabilities in the project, please talk privately to **[email protected]**. Thanks! | ||
5. If you're interested in using APIs, we have experimental support with [documentation](https://godoc.org/github.com/go-gitea/go-sdk). | ||
6. If your team/company is using Gogs and would like to put your logo on [our website](https://gogs.io), contact us by any means. | ||
1. **YOU MUST READ THE [Contributors Guide](https://github.com/go-gitea/gitea/CONTRIBUTING.md) BEFORE STARTING TO WORK ON A PULL REQUEST**. | ||
4. If you think there are vulnerabilities in the project, please talk privately to **[email protected]**. Thanks! | ||
6. If your team/company is using Gogs and would like to put your logo on [our website](https://gitea.io), contact us by any means. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
## Purpose | ||
|
||
The goal of this project is to make the easiest, fastest, and most painless way of setting up a self-hosted Git service. With Go, this can be done with an independent binary distribution across **ALL platforms** that Go supports, including Linux, Mac OS X, Windows and ARM. | ||
|
||
## Overview | ||
|
||
- Please see the [Documentation](https://gogs.io/docs/intro) for common usages and change log. | ||
- See the [Trello Board](https://trello.com/b/uxAoeLUl/gogs-go-git-service) to follow the develop team. | ||
- Want to try it before doing anything else? Do it [online](https://try.gogs.io/gogs/gogs)! | ||
- Having trouble? Get help with [Troubleshooting](https://gogs.io/docs/intro/troubleshooting.html) or [User Forum](https://discuss.gogs.io/). | ||
- Want to help with localization? Check out the [guide](https://gogs.io/docs/features/i18n.html)! | ||
|
||
## Features | ||
|
||
- Activity timeline | ||
|
@@ -69,15 +60,14 @@ The goal of this project is to make the easiest, fastest, and most painless way | |
|
||
## Installation | ||
|
||
Make sure you install the [prerequisites](https://gogs.io/docs/installation) first. | ||
**Note: As Gitea is a [Gogs](https://github.com/gogits/gogs) fork, tutorials and documentation related to gogs applies to Gitea too** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
There are 5 ways to install Gogs: | ||
There are 2 ways to install Gitea: | ||
|
||
- [Install from binary](https://gogs.io/docs/installation/install_from_binary.html) | ||
- [Install from source](https://gogs.io/docs/installation/install_from_source.html) | ||
- [Install from packages](https://gogs.io/docs/installation/install_from_packages.html) | ||
- [Ship with Docker](https://github.com/go-gitea/gitea/tree/master/docker) | ||
- [Install with Vagrant](https://github.com/geerlingguy/ansible-vagrant-examples/tree/master/gogs) | ||
- [Install with Vagrant](https://github.com/go-gitea/examples/tree/master/vagrant) | ||
|
||
**Note: binary release will be available soon** | ||
|
||
### Tutorials | ||
|
||
|
@@ -133,7 +123,7 @@ There are 5 ways to install Gogs: | |
|
||
## Contributors | ||
|
||
- Ex-team members [@lunny](https://github.com/lunny), [@fuxiaohei](https://github.com/fuxiaohei) and [@slene](https://github.com/slene). | ||
- see [Maintainer page](https://github.com/orgs/go-gitea/people) | ||
- See [contributors page](https://github.com/go-gitea/gitea/graphs/contributors) for full list of contributors. | ||
- See [TRANSLATORS](conf/locale/TRANSLATORS) for public list of translators. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
# Docker for Gogs | ||
# Docker for Gitea | ||
|
||
Visit [Docker Hub](https://hub.docker.com/r/gogs/) see all available images and tags. | ||
Visit [Docker Hub](https://hub.docker.com/r/gitea/) see all available images and tags. | ||
|
||
## Usage | ||
|
||
To keep your data out of Docker container, we do a volume (`/var/gogs` -> `/data`) here, and you can change it based on your situation. | ||
To keep your data out of Docker container, we do a volume (`/var/gitea` -> `/data`) here, and you can change it based on your situation. | ||
|
||
``` | ||
# Pull image from Docker Hub. | ||
$ docker pull gogs/gogs | ||
$ docker pull gitea/gitea | ||
|
||
# Create local directory for volume. | ||
$ mkdir -p /var/gogs | ||
$ mkdir -p /var/gitea | ||
|
||
# Use `docker run` for the first time. | ||
$ docker run --name=gogs -p 10022:22 -p 10080:3000 -v /var/gogs:/data gogs/gogs | ||
$ docker run --name=gitea -p 10022:22 -p 10080:3000 -v /var/gitea:/data gitea/gitea | ||
|
||
# Use `docker start` if you have stopped it. | ||
$ docker start gogs | ||
$ docker start gitea | ||
``` | ||
|
||
Note: It is important to map the Gogs ssh service from the container to the host and set the appropriate SSH Port and URI settings when setting up Gogs for the first time. To access and clone Gogs Git repositories with the above configuration you would use: `git clone ssh://git@hostname:10022/username/myrepo.git` for example. | ||
Note: It is important to map the gitea ssh service from the container to the host and set the appropriate SSH Port and URI settings when setting up gitea for the first time. To access and clone gitea Git repositories with the above configuration you would use: `git clone ssh://git@hostname:10022/username/myrepo.git` for example. | ||
|
||
Files will be store in local path `/var/gogs` in my case. | ||
Files will be store in local path `/var/gitea` in my case. | ||
|
||
Directory `/var/gogs` keeps Git repositories and Gogs data: | ||
Directory `/var/gitea` keeps Git repositories and gitea data: | ||
|
||
/var/gogs | ||
/var/gitea | ||
|-- git | ||
| |-- gogs-repositories | ||
| |-- gitea-repositories | ||
|-- ssh | ||
| |-- # ssh public/private keys for Gogs | ||
|-- gogs | ||
| |-- # ssh public/private keys for gitea | ||
|-- gitea | ||
|-- conf | ||
|-- data | ||
|-- log | ||
|
@@ -42,51 +42,39 @@ If you're more comfortable with mounting data to a data container, the commands | |
|
||
``` | ||
# Create data container | ||
docker run --name=gogs-data --entrypoint /bin/true gogs/gogs | ||
docker run --name=gitea-data --entrypoint /bin/true gitea/gitea | ||
|
||
# Use `docker run` for the first time. | ||
docker run --name=gogs --volumes-from gogs-data -p 10022:22 -p 10080:3000 gogs/gogs | ||
docker run --name=gitea --volumes-from gitea-data -p 10022:22 -p 10080:3000 gitea/gitea | ||
``` | ||
|
||
#### Using Docker 1.9 Volume command | ||
#### Using Docker Volume command | ||
|
||
``` | ||
# Create docker volume. | ||
$ docker volume create --name gogs-data | ||
$ docker volume create --name gitea-data | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's techincally no need for this, since |
||
|
||
# Use `docker run` for the first time. | ||
$ docker run --name=gogs -p 10022:22 -p 10080:3000 -v gogs-data:/data gogs/gogs | ||
$ docker run --name=gitea -p 10022:22 -p 10080:3000 -v gitea-data:/data gitea/gitea | ||
``` | ||
|
||
## Settings | ||
|
||
### Application | ||
|
||
Most of settings are obvious and easy to understand, but there are some settings can be confusing by running Gogs inside Docker: | ||
Most of settings are obvious and easy to understand, but there are some settings can be confusing by running gitea inside Docker: | ||
|
||
- **Repository Root Path**: keep it as default value `/home/git/gogs-repositories` because `start.sh` already made a symbolic link for you. | ||
- **Repository Root Path**: keep it as default value `/home/git/gitea-repositories` because `start.sh` already made a symbolic link for you. | ||
- **Run User**: keep it as default value `git` because `start.sh` already setup a user with name `git`. | ||
- **Domain**: fill in with Docker container IP (e.g. `192.168.99.100`). But if you want to access your Gogs instance from a different physical machine, please fill in with the hostname or IP address of the Docker host machine. | ||
- **Domain**: fill in with Docker container IP (e.g. `192.168.99.100`). But if you want to access your gitea instance from a different physical machine, please fill in with the hostname or IP address of the Docker host machine. | ||
- **SSH Port**: Use the exposed port from Docker container. For example, your SSH server listens on `22` inside Docker, but you expose it by `10022:22`, then use `10022` for this value. **Builtin SSH server is not recommended inside Docker Container** | ||
- **HTTP Port**: Use port you want Gogs to listen on inside Docker container. For example, your Gogs listens on `3000` inside Docker, and you expose it by `10080:3000`, but you still use `3000` for this value. | ||
- **HTTP Port**: Use port you want gitea to listen on inside Docker container. For example, your gitea listens on `3000` inside Docker, and you expose it by `10080:3000`, but you still use `3000` for this value. | ||
- **Application URL**: Use combination of **Domain** and **exposed HTTP Port** values (e.g. `http://192.168.99.100:10080/`). | ||
|
||
Full documentation of application settings can be found [here](https://gogs.io/docs/advanced/configuration_cheat_sheet.html). | ||
|
||
### Container options | ||
|
||
This container have some options available via environment variables, these options are opt-in features that can help the administration of this container: | ||
|
||
- **SOCAT_LINK**: | ||
- <u>Possible value:</u> | ||
`true`, `false`, `1`, `0` | ||
- <u>Default:</u> | ||
`true` | ||
- <u>Action:</u> | ||
Bind linked docker container to localhost socket using socat. | ||
Any exported port from a linked container will be binded to the matching port on localhost. | ||
- <u>Disclaimer:</u> | ||
As this option rely on the environment variable created by docker when a container is linked, this option should be deactivated in managed environment such as Rancher or Kubernetes (set to `0` or `false`) | ||
- **RUN_CROND**: | ||
- <u>Possible value:</u> | ||
`true`, `false`, `1`, `0` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Has |
||
|
@@ -99,11 +87,11 @@ This container have some options available via environment variables, these opti | |
|
||
:exclamation::exclamation::exclamation:<span style="color: red">**Make sure you have volumed data to somewhere outside Docker container**</span>:exclamation::exclamation::exclamation: | ||
|
||
Steps to upgrade Gogs with Docker: | ||
Steps to upgrade gitea with Docker: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
- `docker pull gogs/gogs` | ||
- `docker stop gogs` | ||
- `docker rm gogs` | ||
- `docker pull gitea/gitea` | ||
- `docker stop gitea` | ||
- `docker rm gitea` | ||
- Finally, create container as the first time and don't forget to do same volume and port mapping. | ||
|
||
## Known Issues | ||
|
This file was deleted.
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.
change the list numbers ;)