Docker config for @recaptime.dev's Knot server on Hack Club Nest. knot.hackclub.community
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

ci: enable docker builds via GitLab CI

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@andreijiroh.dev>

+51
+51
.gitlab-ci.yaml
··· 1 + default: 2 + image: "${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:29.1.1-cli" 3 + services: 4 + - name: "${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:29.1.1-dind" 5 + alias: docker 6 + before_script: 7 + - docker info 8 + - echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin 9 + - echo "$CI_DEPENDENCY_PROXY_PASSWORD" | docker login $CI_DEPENDENCY_PROXY_SERVER -u $CI_DEPENDENCY_PROXY_USER --password-stdin 10 + 11 + variables: 12 + # When you use the dind service, you must instruct Docker to talk with 13 + # the daemon started inside of the service. The daemon is available 14 + # with a network connection instead of the default 15 + # /var/run/docker.sock socket. Docker 19.03 does this automatically 16 + # by setting the DOCKER_HOST in 17 + # https://github.com/docker-library/docker/blob/d45051476babc297257df490d22cbd806f1b11e4/19.03/docker-entrypoint.sh#L23-L29 18 + # 19 + # The 'docker' hostname is the alias of the service container as described at 20 + # https://docs.gitlab.com/ee/ci/services/#accessing-the-services. 21 + # 22 + # Specify to Docker where to create the certificates. Docker 23 + # creates them automatically on boot, and creates 24 + # `/certs/client` to share between the service and job 25 + # container, thanks to volume mount from config.toml 26 + DOCKER_TLS_CERTDIR: "/certs" 27 + # Sync with https://tangled.org/tangled.org/core/releases 28 + KNOT_RELEASE_TAG: v1.11.0-aplha 29 + # Match the Nest UID/GID of RecapTime.dev's shell account 30 + UID: "2897" 31 + GID: "2897" 32 + # build args-based base images to use Dependency Proxy on CI 33 + DEPLOY_IMAGE: "$CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/alpine:edge" 34 + BUILDER_IMAGE: "$CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/golang:1.24-alpine" 35 + # enable buildkit 36 + DOCKER_BUILDKIT: "1" 37 + 38 + build: 39 + stage: build 40 + script: 41 + - | 42 + docker build \ 43 + -t $CI_REGISTRY/$CI_PROJECT_PATH:$CI_COMMIT_REF_SLUG \ 44 + -t $CI_REGISTRY/$CI_PROJECT_PATH:latest \ 45 + --build-arg TAG=$KNOT_RELEASE_TAG \ 46 + --build-arg UID=$UID \ 47 + --build-arg GID=$GID \ 48 + --build-arg DEPLOY_IMAGE=$DEPLOY_IMAGE \ 49 + --build-arg BUILDER_IMAGE=$BUILDER_IMAGE . 50 + - docker push $CI_REGISTRY/$CI_PROJECT_PATH:$CI_COMMIT_REF_SLUG 51 + - docker push $CI_REGISTRY/$CI_PROJECT_PATH:latest