README.md 1.9 KB

Install Gogs With Docker

Deploying gogs using Docker is as easy as pie. Simple open the /dockerfiles/build.sh file and replace the initial configuration settings:

DB_TYPE="YOUR_DB_TYPE"            # type of database, supports either 'mysql' or 'postgres'
MEM_TYPE="YOUR_MEM_TYPE"          # type of memory database, supports either 'redis' or 'memcache'
DB_PASSWORD="YOUR_DB_PASSWORD"    # The database password
DB_RUN_NAME="YOUR_DB_RUN_NAME"    # The --name option value to use when running the database image
MEM_RUN_NAME="YOUR_MEM_RUN_NAME"  # The --name option value to use when running the memory database image
HOST_PORT="YOUR_HOST_PORT"        # The port to expose the app on (redirected to 3000 inside the gogs container)

And run:

cd dockerfiles
./build.sh

The build will take some time, just be patient. After it finishes, it will display a message that looks like this (the content may be different, depending on your configuration options):

Now we have the MySQL image(running) and gogs image, use the follow command to start gogs service:
docker run -i -t --link YOUR_DB_RUN_NAME:db --link YOUR_MEM_RUN_NAME:mem -p YOUR_HOST_PORT:3000 gogits/gogs

To run the container, just copy the above command:

docker run -i -t --link YOUR_DB_RUN_NAME:db --link YOUR_MEM_RUN_NAME:mem -p YOUR_HOST_PORT:3000 gogits/gogs

Now gogs should be running! Open your browser and navigate to:

http://YOUR_HOST_IP:YOUR_HOST_PORT

During the installation procedure, use the following information:

  • The database type should be whichever DB_TYPE you selected above

  • The database host should be either db:5432 or db:3306 for PostgreSQL and MySQL respectively

  • The RUN_USER should be whichever user you're running the container with. Ideally that's git, but your individual configuration may vary

  • Everything else is configured like a normal gogs installation

Let's 'gogs'! Ouya~

PANIC: session(release): write data/sessions/c/4/c47bcc7804687c5c: no space left on device

PANIC

session(release): write data/sessions/c/4/c47bcc7804687c5c: no space left on device
github.com/go-macaron/session@v0.0.0-20190805070824-1a3cdc6f5659/session.go:199 (0x8b2934)
gopkg.in/macaron.v1@v1.3.9/context.go:79 (0x83d0a0)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/context.go:112 (0x84fdb5)
gopkg.in/macaron.v1@v1.3.9/recovery.go:161 (0x84fda8)
gopkg.in/macaron.v1@v1.3.9/logger.go:40 (0x840c73)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/router.go:187 (0x850fc6)
gopkg.in/macaron.v1@v1.3.9/router.go:303 (0x8493e5)
gopkg.in/macaron.v1@v1.3.9/macaron.go:220 (0x841fca)
net/http/server.go:2836 (0x7a79b2)
net/http/server.go:1924 (0x7a341b)
runtime/asm_amd64.s:1373 (0x46f9f0)