tangled
alpha
login
or
join now
tangled.org
/
knot-docker
90
fork
atom
Community maintained Docker config for the knot server
90
fork
atom
overview
issues
3
pulls
1
pipelines
Update publish.yml
knotbin.com
6 months ago
68de47b3
8b517de8
0/1
publish.yml
failed
1s
+25
-88
1 changed file
expand all
collapse all
unified
split
.tangled
workflows
publish.yml
+25
-88
.tangled/workflows/publish.yml
···
77
77
fi
78
78
79
79
# Create manifest.json
80
80
-
cat > docker-image/manifest.json << EOF
81
81
-
[
82
82
-
{
83
83
-
"Config": "config.json",
84
84
-
"RepoTags": ["$DOCKER_USERNAME/$DOCKER_REPO:$TAG"],
85
85
-
"Layers": ["layer.tar"]
86
86
-
}
87
87
-
]
88
88
-
EOF
80
80
+
echo '[' > docker-image/manifest.json
81
81
+
echo ' {' >> docker-image/manifest.json
82
82
+
echo ' "Config": "config.json",' >> docker-image/manifest.json
83
83
+
echo " \"RepoTags\": [\"tngl/knot:$TAG\"]," >> docker-image/manifest.json
84
84
+
echo ' "Layers": ["layer.tar"]' >> docker-image/manifest.json
85
85
+
echo ' }' >> docker-image/manifest.json
86
86
+
echo ']' >> docker-image/manifest.json
89
87
90
90
-
# Create config.json
91
91
-
cat > docker-image/config.json << EOF
92
92
-
{
93
93
-
"architecture": "amd64",
94
94
-
"config": {
95
95
-
"Hostname": "",
96
96
-
"Domainname": "",
97
97
-
"User": "",
98
98
-
"AttachStdin": false,
99
99
-
"AttachStdout": false,
100
100
-
"AttachStderr": false,
101
101
-
"ExposedPorts": {
102
102
-
"22/tcp": {},
103
103
-
"5555/tcp": {}
104
104
-
},
105
105
-
"Tty": false,
106
106
-
"OpenStdin": false,
107
107
-
"StdinOnce": false,
108
108
-
"Env": [
109
109
-
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
110
110
-
"KNOT_REPO_SCAN_PATH=/home/git/repositories"
111
111
-
],
112
112
-
"Cmd": null,
113
113
-
"Image": "",
114
114
-
"Volumes": null,
115
115
-
"WorkingDir": "/app",
116
116
-
"Entrypoint": ["/init"],
117
117
-
"OnBuild": null,
118
118
-
"Labels": {
119
119
-
"org.opencontainers.image.title": "knot",
120
120
-
"org.opencontainers.image.description": "data server for tangled",
121
121
-
"org.opencontainers.image.source": "https://tangled.sh/@tangled.sh/knot-docker"
122
122
-
}
123
123
-
},
124
124
-
"container_config": {
125
125
-
"Hostname": "",
126
126
-
"Domainname": "",
127
127
-
"User": "",
128
128
-
"AttachStdin": false,
129
129
-
"AttachStdout": false,
130
130
-
"AttachStderr": false,
131
131
-
"ExposedPorts": {
132
132
-
"22/tcp": {},
133
133
-
"5555/tcp": {}
134
134
-
},
135
135
-
"Tty": false,
136
136
-
"OpenStdin": false,
137
137
-
"StdinOnce": false,
138
138
-
"Env": [
139
139
-
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
140
140
-
"KNOT_REPO_SCAN_PATH=/home/git/repositories"
141
141
-
],
142
142
-
"Cmd": null,
143
143
-
"Image": "",
144
144
-
"Volumes": null,
145
145
-
"WorkingDir": "/app",
146
146
-
"Entrypoint": ["/init"],
147
147
-
"OnBuild": null,
148
148
-
"Labels": {
149
149
-
"org.opencontainers.image.title": "knot",
150
150
-
"org.opencontainers.image.description": "data server for tangled",
151
151
-
"org.opencontainers.image.source": "https://tangled.sh/@tangled.sh/knot-docker"
152
152
-
}
153
153
-
},
154
154
-
"created": "$(date -u +%Y-%m-%dT%H:%M:%S.%NZ)",
155
155
-
"docker_version": "manual",
156
156
-
"history": [
157
157
-
{
158
158
-
"created": "$(date -u +%Y-%m-%dT%H:%M:%S.%NZ)",
159
159
-
"created_by": "manual build"
160
160
-
}
161
161
-
],
162
162
-
"os": "linux",
163
163
-
"rootfs": {
164
164
-
"type": "layers",
165
165
-
"diff_ids": ["sha256:0000000000000000000000000000000000000000000000000000000000000000"]
166
166
-
}
167
167
-
}
168
168
-
EOF
88
88
+
# Create config.json using printf to handle complex JSON
89
89
+
printf '{\n' > docker-image/config.json
90
90
+
printf ' "architecture": "amd64",\n' >> docker-image/config.json
91
91
+
printf ' "config": {\n' >> docker-image/config.json
92
92
+
printf ' "ExposedPorts": {"22/tcp": {}, "5555/tcp": {}},\n' >> docker-image/config.json
93
93
+
printf ' "Env": ["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "KNOT_REPO_SCAN_PATH=/home/git/repositories"],\n' >> docker-image/config.json
94
94
+
printf ' "WorkingDir": "/app",\n' >> docker-image/config.json
95
95
+
printf ' "Entrypoint": ["/init"],\n' >> docker-image/config.json
96
96
+
printf ' "Labels": {\n' >> docker-image/config.json
97
97
+
printf ' "org.opencontainers.image.title": "knot",\n' >> docker-image/config.json
98
98
+
printf ' "org.opencontainers.image.description": "data server for tangled",\n' >> docker-image/config.json
99
99
+
printf ' "org.opencontainers.image.source": "https://tangled.sh/@tangled.sh/knot-docker"\n' >> docker-image/config.json
100
100
+
printf ' }\n' >> docker-image/config.json
101
101
+
printf ' },\n' >> docker-image/config.json
102
102
+
printf ' "created": "2025-01-01T00:00:00.000000000Z",\n' >> docker-image/config.json
103
103
+
printf ' "os": "linux",\n' >> docker-image/config.json
104
104
+
printf ' "rootfs": {"type": "layers", "diff_ids": ["sha256:0000000000000000000000000000000000000000000000000000000000000000"]}\n' >> docker-image/config.json
105
105
+
printf '}\n' >> docker-image/config.json
169
106
170
107
# Create layer
171
108
cd docker-image