a@ubuntu:~$ sudo apt install docker
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
docker
0 upgraded, 1 newly installed, 0 to remove and 379 not upgraded.
Need to get 12.9 kB of archives.
After this operation, 45.1 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 docker amd64 1.5-1build1 [12.9 kB]
Fetched 12.9 kB in 1s (15.6 kB/s)
Selecting previously unselected package docker.
(Reading database ... 125871 files and directories currently installed.)
Preparing to unpack .../docker_1.5-1build1_amd64.deb ...
Unpacking docker (1.5-1build1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Setting up docker (1.5-1build1) ...
a@ubuntu:~$ sudo apt install docker.io
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
a@ubuntu:~$ sudo service docker start
[sudo] password for a:
a@ubuntu:~$ sudo docker pull gogs/gogs
Using default tag: latest
latest: Pulling from gogs/gogs
8e402f1a9c57: Pull complete
52737f1a2fe8: Pull complete
3f6c21ac12a1: Pull complete
c35f51e0ce00: Pull complete
f26bdc34d493: Pull complete
974ea71639e7: Pull complete
f311be52f06d: Pull complete
bc99f400af3b: Pull complete
5b059e0d53f3: Pull complete
fda5695e604b: Pull complete
Digest: sha256:d3f97051eda53aae7604a8237b1546f48020189be981d4cd50466326ee060deb
Status: Downloaded newer image for gogs/gogs:latest
a@ubuntu:~$ sudo mkdir -p /var/gogs
a@ubuntu:~$ sudo docker run --name=gogs -p 10022:22 -p 10080:3000 -v /var/gogs:/data gogs/gogs
usermod: no changes
Jun 27 09:09:14 syslogd started: BusyBox v1.29.3
Jun 27 09:09:15 sshd[33]: Server listening on :: port 22.
Jun 27 09:09:15 sshd[33]: Server listening on 0.0.0.0 port 22.
数据库配置见:
首先建立好数据库。在 Gogs 目录的 scripts/mysql.sql
文件是数据库初始化文件。执行 mysql -u root -p < scripts/mysql.sql
(需要输入密码)即可初始化好数据库。
然后登录 MySQL 创建一个新用户 gogs,并将数据库 gogs
的所有权限都赋予该用户。
https://blog.mynook.info/post/host-your-own-git-server-using-gogs/
创建gogs 数据
SET GLOBAL innodb_file_per_table = ON,
innodb_file_format = Barracuda,
innodb_large_prefix = ON;
DROP DATABASE IF EXISTS gogs;
CREATE DATABASE IF NOT EXISTS gogs CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
create user 'gogsAb'@'localhost' identified by 'pwd'
$ mysql -u root -p
> # (输入密码)
create user 'gogs'@'172.17.0.3' identified by 'pwd';
grant all privileges on gogs.* to 'gogsAb'@'localhost';
grant all privileges on gogs.* to 'gogs'@'172.17.0.3';
grant all privileges on gogs.* to 'gogs'@'%' identified by 'pwd' with grant option;
flush privileges;
exit;
$docker run --name gogs-mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:latest
$docker run --name=gogs -p 10022:22 -p 10080:3000 -v /var/gogs:/data --link gogs-mysql:mysql gogs/gogs
https://blog.csdn.net/CAIYUNFREEDOM/article/details/97291986
gogs 邮箱服务配置 设置管理员账号