@@ -8,23 +8,23 @@ inputs:
8
8
insecureRegistries :
9
9
description : ' The gateway hostname address or IP address.'
10
10
required : true
11
- default : " \" 192.168.128.1:5000 \" "
11
+ default : " "
12
12
registryMirrors :
13
- description : ' Whether to use TLS .'
13
+ description : ' Registry mirrors for the Docker daemon .'
14
14
required : true
15
- default : " \" http ://192.168.128.1:5000\" "
15
+ default : " \" https ://192.168.128.1:5000\" "
16
16
buildkitRegistryMirror :
17
17
description : ' Registry mirror to be used by buildx builder.'
18
18
required : true
19
19
default : " \" 192.168.128.1:5000\" "
20
20
buildkitRegistryHTTP :
21
- description : ' Whether to us HTTP.'
21
+ description : ' Whether to use HTTP instead of HTTPS .'
22
22
required : true
23
- default : " true "
23
+ default : " false "
24
24
buildkitRegistryInsecure :
25
25
description : ' Whether to use TLS.'
26
26
required : true
27
- default : " true "
27
+ default : " false "
28
28
29
29
runs :
30
30
using : ' composite'
@@ -37,19 +37,31 @@ runs:
37
37
REG_MIRRORS : ${{ inputs.registryMirrors }}
38
38
run : |
39
39
sudo mkdir -p /etc/docker
40
- cat <<EOF | sudo tee /etc/docker/daemon.json
41
- {
42
- "insecure-registries" : [${INSECURE_REG} ],
43
- "registry-mirrors": [${REG_MIRRORS}]
44
- }
45
- EOF
40
+ if [ -n "$INSECURE_REG" ] ; then
41
+ cat <<EOF | sudo tee /etc/docker/daemon.json
42
+ {
43
+ "insecure-registries" : [${INSECURE_REG} ],
44
+ "registry-mirrors": [${REG_MIRRORS}]
45
+ }
46
+ EOF
47
+ else
48
+ if [ -n $INSECURE_REG ] ;
49
+ cat <<EOF | sudo tee /etc/docker/daemon.json
50
+ {
51
+ "registry-mirrors": [${REG_MIRRORS}]
52
+ }
53
+ EOF
54
+ fi
46
55
- name : Reload Docker
47
56
shell : bash
48
57
id : reload-docker
49
58
run : |
50
59
sudo cat /etc/docker/daemon.json
51
60
sudo systemctl daemon-reload && sudo systemctl restart docker
52
- - name : Configure buildx
61
+
62
+ # Step with http and insecure sections included
63
+ - name : Configure buildx with insecure registry
64
+ if : ${{ inputs.buildkitRegistryInsecure == 'true' }}
53
65
uses : docker/setup-buildx-action@v3
54
66
with :
55
67
# AE: This appeared to have an issue for a user, so it's being set to
63
75
[registry.${{ inputs.buildkitRegistryMirror }}]
64
76
http = ${{ inputs.buildkitRegistryHTTP }}
65
77
insecure = ${{ inputs.buildkitRegistryInsecure }}
78
+
79
+ # Step without http and insecure sections
80
+ - name : Configure buildx without insecure registry
81
+ if : ${{ inputs.buildkitRegistryInsecure != 'true' }}
82
+ uses : docker/setup-buildx-action@v3
83
+ with :
84
+ # AE: This appeared to have an issue for a user, so it's being set to
85
+ # false for now.
86
+ cache-binary : false
87
+ buildkitd-config-inline : |
88
+ [registry."docker.io"]
89
+ mirrors = [${{ inputs.buildkitRegistryMirror }}]
90
+ [registry.${{ inputs.buildkitRegistryMirror }}]
0 commit comments