From a26d6f5e0947b595f87e5e49667acf747f86558b Mon Sep 17 00:00:00 2001 From: Ben Kreeger Date: Thu, 11 Sep 2025 22:21:15 -0500 Subject: [PATCH] Add README, github workflow --- .github/workflows/publish.yaml | 45 ++++++++++++++++++++++++++++++++++ README.md | 34 +++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 .github/workflows/publish.yaml create mode 100644 README.md diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..e211f6b --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,45 @@ +--- +name: Publish +on: + push: {branches: ["main"]} + workflow_dispatch: + workflow_run: + branches: ["main"] + types: + - completed +jobs: + publish: + name: Build and publish + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: {fetch-depth: 0} + + - name: Login to container registry + uses: docker/login-action@v3 + with: + registry: https://git.kree.gr + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.IMAGE_NAME }} + flavor: | + latest=auto + prefix= + suffix= + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=sha,prefix= + + - name: Build and publish + uses: devcontainers/ci@v0.3 + with: + imageName: git.kree.gr/kreeger/devcontainer + cacheFrom: git.kree.gr/kreeger/devcontainer + push: always diff --git a/README.md b/README.md new file mode 100644 index 0000000..46f2cfd --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# Kreeger's devcontainer + +A devcontainer build that I use as the base for all my dev work. + +## Building locally + +Make sure you have the prerequisites installed. For me this meant BuildX and +BuildKit for Docker. + +```bash +$ brew install docker-buildx +$ brew install buildkit +$ VERSION=$(curl https://api.github.com/repos/docker/buildx/releases/latest -s | jq .name -r) +$ ARCH=arm64 +$ curl -LO https://github.com/docker/buildx/releases/download/${VERSION}/buildx-${VERSION}.darwin-${ARCH} +$ mkdir -p ~/.docker/cli-plugins +$ mv buildx-${VERSION}.darwin-${ARCH} ~/.docker/cli-plugins/docker-buildx +$ chmod +x ~/.docker/cli-plugins/docker-buildx +$ docker buildx version +``` + +Login to Gitea. + +```bash +$ docker login git.kree.gr +``` + +And then build the thing. + +```bash +$ DOCKER_BUILDKIT=1 devcontainer build --workspace-folder . \ + --push true --image-name \ + git.kree.gr/kreeger/devcontainer:${$(git rev-parse HEAD):-8} +```