This Gogs image is for demo purpose, including demo/go-web-hello-world repo history.
109
The original Gogs from: https://hub.docker.com/r/gogs/gogs
# Pull image from Docker Hub.
$ docker pull dorisyangforever/gogs_backup:v1
# Create local directory for volume.
$ sudo mkdir -p /var/gogs
# Use docker run for the first time.
$ docker run --name=gogs -p 10022:22 -p 3100:3000 -v /var/gogs:/data dorisyangforever/gogs_backup:v1
# Open another terminal to find the running container's PID
$ MYPID=docker ps | grep dorisyangfor | awk '{print $1}' && echo $MYPID
# Copy backup data package from the container
$ docker cp $MYPID:app/gogs/gogsbackup ~
$ docker cp $MYPID:app/gogs/gitbackup ~
# Copy the backup data to /var/gogs/, need sudo
$ sudo cp -r ~/gogsbackup/* /var/gogs/gogs/
$ sudo cp -r ~/gitbackup/* /var/gogs/git/
# Change privilege, due to the influence of previous cp command, otherwise some file under container /data cannot be read
$ sudo chown -R $USER /var/gogs/git/
$ sudo chown -R $USER /var/gogs/gogs/
Then open the browser: http://HOSTIP:3100, on the webpage do the configuration:
Database: SQLite3
Domain: HOSTIP, the IP address of the Docker host machine
SSH Port: 10022 (exposed port from Docker container)
HTTP Port: 3000 (listening port inside Docker container)
Application URL: http://HOSTIP:3100/
Optional Settings->Admin Account Settings username: root password: 123456
Then visit: http://HOSTIP:3100/demo/go-web-hello-world, you can see all the history of the demo/go-web-hello-world repo
# Use docker start if you have stopped it.
$ docker start gogs
Other general Gogs info and instruction, please refer to https://hub.docker.com/r/gogs/gogs
Content type
Image
Digest
sha256:0a776c575…
Size
43.6 MB
Last updated
about 4 years ago
docker pull dorisyangforever/gogs_backup:v1