Community maintained Docker config for the knot server

Update publish.yml

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