Skip to content

Commit e180456

Browse files
techknowlogick6543lafrikskdumontnu
authored
Change docker tag logic (#16421)
* Change docker logic * Apply suggestions from code review Co-authored-by: Kyle D. <[email protected]> * docs Co-authored-by: 6543 <[email protected]> Co-authored-by: Lauris BH <[email protected]> Co-authored-by: Kyle D. <[email protected]>
1 parent 14b6257 commit e180456

File tree

5 files changed

+197
-24
lines changed

5 files changed

+197
-24
lines changed

.drone.yml

Lines changed: 179 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ steps:
691691

692692
---
693693
kind: pipeline
694-
name: docker-linux-amd64-release
694+
name: docker-linux-amd64-release-version
695695

696696
platform:
697697
os: linux
@@ -703,7 +703,6 @@ depends_on:
703703

704704
trigger:
705705
ref:
706-
- refs/heads/main
707706
- "refs/tags/**"
708707
event:
709708
exclude:
@@ -754,6 +753,70 @@ steps:
754753
exclude:
755754
- pull_request
756755

756+
---
757+
kind: pipeline
758+
name: docker-linux-amd64-release
759+
760+
platform:
761+
os: linux
762+
arch: amd64
763+
764+
depends_on:
765+
- testing-amd64
766+
- testing-arm64
767+
768+
trigger:
769+
ref:
770+
- refs/heads/main
771+
event:
772+
exclude:
773+
- cron
774+
775+
steps:
776+
- name: fetch-tags
777+
image: docker:git
778+
commands:
779+
- git fetch --tags --force
780+
781+
- name: publish
782+
pull: always
783+
image: techknowlogick/drone-docker:latest
784+
settings:
785+
auto_tag: false
786+
tags: dev-linux-amd64
787+
repo: gitea/gitea
788+
build_args:
789+
- GOPROXY=off
790+
password:
791+
from_secret: docker_password
792+
username:
793+
from_secret: docker_username
794+
when:
795+
event:
796+
exclude:
797+
- pull_request
798+
799+
- name: publish-rootless
800+
image: techknowlogick/drone-docker:latest
801+
settings:
802+
dockerfile: Dockerfile.rootless
803+
auto_tag: false
804+
tags: dev-linux-amd64-rootless
805+
repo: gitea/gitea
806+
build_args:
807+
- GOPROXY=off
808+
password:
809+
from_secret: docker_password
810+
username:
811+
from_secret: docker_username
812+
environment:
813+
PLUGIN_MIRROR:
814+
from_secret: plugin_mirror
815+
when:
816+
event:
817+
exclude:
818+
- pull_request
819+
757820
---
758821
kind: pipeline
759822
name: docker-linux-arm64-dry-run
@@ -788,7 +851,7 @@ steps:
788851

789852
---
790853
kind: pipeline
791-
name: docker-linux-arm64-release
854+
name: docker-linux-arm64-release-version
792855

793856
platform:
794857
os: linux
@@ -800,7 +863,6 @@ depends_on:
800863

801864
trigger:
802865
ref:
803-
- refs/heads/main
804866
- "refs/tags/**"
805867
event:
806868
exclude:
@@ -856,7 +918,73 @@ steps:
856918

857919
---
858920
kind: pipeline
859-
name: docker-manifest
921+
name: docker-linux-arm64-release
922+
923+
platform:
924+
os: linux
925+
arch: arm64
926+
927+
depends_on:
928+
- testing-amd64
929+
- testing-arm64
930+
931+
trigger:
932+
ref:
933+
- refs/heads/main
934+
event:
935+
exclude:
936+
- cron
937+
938+
steps:
939+
- name: fetch-tags
940+
image: docker:git
941+
commands:
942+
- git fetch --tags --force
943+
944+
- name: publish
945+
pull: always
946+
image: techknowlogick/drone-docker:latest
947+
settings:
948+
auto_tag: false
949+
tags: dev-linux-arm64
950+
repo: gitea/gitea
951+
build_args:
952+
- GOPROXY=off
953+
password:
954+
from_secret: docker_password
955+
username:
956+
from_secret: docker_username
957+
environment:
958+
PLUGIN_MIRROR:
959+
from_secret: plugin_mirror
960+
when:
961+
event:
962+
exclude:
963+
- pull_request
964+
965+
- name: publish-rootless
966+
image: techknowlogick/drone-docker:latest
967+
settings:
968+
dockerfile: Dockerfile.rootless
969+
auto_tag: false
970+
tags: dev-linux-arm64-rootless
971+
repo: gitea/gitea
972+
build_args:
973+
- GOPROXY=off
974+
password:
975+
from_secret: docker_password
976+
username:
977+
from_secret: docker_username
978+
environment:
979+
PLUGIN_MIRROR:
980+
from_secret: plugin_mirror
981+
when:
982+
event:
983+
exclude:
984+
- pull_request
985+
---
986+
kind: pipeline
987+
name: docker-manifest-version
860988

861989
platform:
862990
os: linux
@@ -888,12 +1016,54 @@ steps:
8881016

8891017
trigger:
8901018
ref:
891-
- refs/heads/main
8921019
- "refs/tags/**"
8931020
event:
8941021
exclude:
8951022
- cron
8961023

1024+
depends_on:
1025+
- docker-linux-amd64-release-version
1026+
- docker-linux-arm64-release-version
1027+
1028+
---
1029+
kind: pipeline
1030+
name: docker-manifest
1031+
1032+
platform:
1033+
os: linux
1034+
arch: amd64
1035+
1036+
steps:
1037+
- name: manifest-rootless
1038+
pull: always
1039+
image: plugins/manifest
1040+
settings:
1041+
auto_tag: false
1042+
ignore_missing: true
1043+
spec: docker/manifest.rootless.tmpl
1044+
password:
1045+
from_secret: docker_password
1046+
username:
1047+
from_secret: docker_username
1048+
1049+
- name: manifest
1050+
image: plugins/manifest
1051+
settings:
1052+
auto_tag: false
1053+
ignore_missing: true
1054+
spec: docker/manifest.tmpl
1055+
password:
1056+
from_secret: docker_password
1057+
username:
1058+
from_secret: docker_username
1059+
1060+
trigger:
1061+
ref:
1062+
- refs/heads/main
1063+
event:
1064+
exclude:
1065+
- cron
1066+
8971067
depends_on:
8981068
- docker-linux-amd64-release
8991069
- docker-linux-arm64-release
@@ -927,7 +1097,10 @@ depends_on:
9271097
- release-latest
9281098
- docker-linux-amd64-release
9291099
- docker-linux-arm64-release
1100+
- docker-linux-amd64-release-version
1101+
- docker-linux-arm64-release-version
9301102
- docker-manifest
1103+
- docker-manifest-version
9311104
- docs
9321105

9331106
steps:

docker/manifest.rootless.tmpl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}-rootless
1+
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}dev{{/if}}-rootless
22
{{#if build.tags}}
33
tags:
44
{{#each build.tags}}
55
- {{this}}-rootless
66
{{/each}}
7+
- "latest-rootless"
78
{{/if}}
89
manifests:
910
-
10-
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64-rootless
11+
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}dev{{/if}}-linux-amd64-rootless
1112
platform:
1213
architecture: amd64
1314
os: linux
1415
-
15-
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64-rootless
16+
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}dev{{/if}}-linux-arm64-rootless
1617
platform:
1718
architecture: arm64
1819
os: linux

docker/manifest.tmpl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
1+
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}dev{{/if}}
22
{{#if build.tags}}
33
tags:
44
{{#each build.tags}}
55
- {{this}}
66
{{/each}}
7+
- "latest"
78
{{/if}}
89
manifests:
910
-
10-
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64
11+
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{else}}dev-{{/if}}linux-amd64
1112
platform:
1213
architecture: amd64
1314
os: linux
1415
-
15-
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64
16+
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{else}}dev-{{/if}}linux-arm64
1617
platform:
1718
architecture: arm64
1819
os: linux
19-
variant: v8
20+
variant: v8

docs/content/doc/installation/with-docker-rootless.en-us.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,14 @@ image as a service. Since there is no database available, one can be initialized
3232
Create a directory for `data` and `config` then paste the following content into a file named `docker-compose.yml`.
3333
Note that the volume should be owned by the user/group with the UID/GID specified in the config file. By default Gitea in docker will use uid:1000 gid:1000. If needed you can set ownership on those folders with the command: `sudo chown 1000:1000 config/ data/`
3434
If you don't give the volume correct permissions, the container may not start.
35-
Also be aware that the tag `:latest-rootless` will install the current development version.
36-
For a stable release you can use `:1-rootless` or specify a certain release like `:{{< version >}}-rootless`.
35+
For a stable release you could use `:latest-rootless`, `:1-rootless` or specify a certain release like `:{{< version >}}-rootless`, but if you'd like to use the latest development version then `:dev-rootless` would be an appropriate tag.
3736

3837
```yaml
3938
version: "2"
4039

4140
services:
4241
server:
43-
image: gitea/gitea:latest-rootless
42+
image: gitea/gitea:{{< version >}}-rootless
4443
restart: always
4544
volumes:
4645
- ./data:/var/lib/gitea
@@ -63,7 +62,7 @@ version: "2"
6362

6463
services:
6564
server:
66-
image: gitea/gitea:latest-rootless
65+
image: gitea/gitea:{{< version >}}-rootless
6766
restart: always
6867
volumes:
6968
- ./data:/var/lib/gitea
@@ -87,7 +86,7 @@ version: "2"
8786

8887
services:
8988
server:
90-
image: gitea/gitea:latest-rootless
89+
image: gitea/gitea:{{< version >}}-rootless
9190
+ environment:
9291
+ - GITEA__database__DB_TYPE=mysql
9392
+ - GITEA__database__HOST=db:3306
@@ -128,7 +127,7 @@ version: "2"
128127

129128
services:
130129
server:
131-
image: gitea/gitea:latest-rootless
130+
image: gitea/gitea:{{< version >}}-rootless
132131
environment:
133132
+ - GITEA__database__DB_TYPE=postgres
134133
+ - GITEA__database__HOST=db:5432
@@ -174,7 +173,7 @@ version: "2"
174173
+
175174
services:
176175
server:
177-
image: gitea/gitea:latest-rootless
176+
image: gitea/gitea:{{< version >}}-rootless
178177
restart: always
179178
volumes:
180179
- - ./data:/var/lib/gitea
@@ -201,7 +200,7 @@ version: "2"
201200

202201
services:
203202
server:
204-
image: gitea/gitea:latest-rootless
203+
image: gitea/gitea:{{< version >}}-rootless
205204
restart: always
206205
+ user: 1001
207206
volumes:
@@ -262,7 +261,7 @@ docker-compose up -d
262261
- Rename folder (inside volume) gitea to custom
263262
- Edit app.ini if needed
264263
- Set START_SSH_SERVER = true
265-
- Use image gitea/gitea:latest-rootless
264+
- Use image gitea/gitea:{{< version >}}-rootless
266265

267266
## Managing Deployments With Environment Variables
268267

docs/content/doc/installation/with-docker.en-us.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ image as a service. Since there is no database available, one can be initialized
3434
Create a directory like `gitea` and paste the following content into a file named `docker-compose.yml`.
3535
Note that the volume should be owned by the user/group with the UID/GID specified in the config file.
3636
If you don't give the volume correct permissions, the container may not start.
37-
Also be aware that the tag `:latest` will install the current development version.
38-
For a stable release you can use `:1` or specify a certain release like `:{{< version >}}`.
37+
For a stable release you can use `:latest`, `:1` or specify a certain release like `:{{< version >}}`, but if you'd like to use the latest development version of Gitea then you could use the `:dev` tag.
3938

4039
```yaml
4140
version: "3"

0 commit comments

Comments
 (0)