Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 43 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,38 @@ permissions:
contents: read

jobs:
get-versions:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.versions.outputs.matrix }}
latest: ${{ steps.latest.outputs.version }}
steps:
- name: Get Go versions
id: versions
run: |
VERSIONS=$(
curl -s 'https://go.dev/dl/?mode=json' \
| jq -r '
[.[] | select(.stable) | .version]
| group_by(split(".")[0:2] | join("."))
| map(max_by(ltrimstr("go") | split(".") | map(tonumber)))[]
' | sed 's/go//'
)
VERSIONS_ARRAY=$(echo "$VERSIONS" | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "matrix={\"go-version\":$VERSIONS_ARRAY}" >> $GITHUB_OUTPUT

- name: Get latest version
id: latest
run: |
matrix='${{ steps.versions.outputs.matrix }}'
latest=$(echo "$matrix" | jq -r '.["go-version"][-1]')
echo "version=$latest" >> $GITHUB_OUTPUT

build-and-push:
needs: get-versions
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.get-versions.outputs.matrix) }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand All @@ -34,16 +64,24 @@ jobs:
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT

- name: Set tags
id: tags
run: |
tags="esacteksab/go:${{ matrix.go-version }}\nesacteksab/go:${{ matrix.go-version }}-${{ steps.date.outputs.date }}"
if [ "${{ matrix.go-version }}" = "${{ needs.get-versions.outputs.latest }}" ]; then
tags="${tags}\nesacteksab/go:latest"
fi
echo "tags<<EOF" >> $GITHUB_OUTPUT
echo -e "$tags" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Build and push Docker image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 #v6.18.0
with:
context: .
push: true
tags: |
esacteksab/go:latest
esacteksab/go:${{ vars.GO_VERSION }}
esacteksab/go:${{ vars.GO_VERSION }}-${{ steps.date.outputs.date }}
tags: ${{ steps.tags.outputs.tags }}
build-args: |
GO_VERSION=${{ vars.GO_VERSION }}
GO_VERSION=${{ matrix.go-version }}
cache-from: type=gha
cache-to: type=gha,mode=max
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,5 @@ terraform.rc
!.vscode/settings.json
# Stores VSCode versions used for testing VSCode extensions
.vscode-test

foo.sh
6 changes: 3 additions & 3 deletions .mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
path = ".venv"

[tools]
golang = "1.25.7"
nodejs = "22.15.1"
pnpm = "10.24.0"
golang = "1.25.8"
nodejs = "22.22.1"
pnpm = "10.32.0"
python = "3.12.10"
uv = "latest"
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ repos:
name: "Git Leaks"

- repo: https://github.com/google/keep-sorted
rev: v0.7.1
rev: v0.8.0
hooks:
- id: keep-sorted
name: "Keep Sorted"

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.35.0
rev: 0.37.0
hooks:
- id: check-github-workflows
- id: check-dependabot
Expand Down Expand Up @@ -90,7 +90,7 @@ repos:
- mdformat-footnote

- repo: https://github.com/crate-ci/typos
rev: v1.40.0
rev: v1.44.0
hooks:
- id: typos
args: [--force-exclude]
Expand All @@ -103,7 +103,7 @@ repos:
name: "Shell Check"

- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.19.1
rev: v0.21.0
hooks:
- id: markdownlint-cli2
name: "Markdown Lint"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:24.04@sha256:cd1dba651b3080c3686ecf4e3c4220f026b521fb76978881737d24f200828b2b AS base

ARG GO_VERSION=1.25.7
ARG GO_VERSION=1.25.8

# Install dependencies, download Go, and set it up in one layer
RUN set -eux && \
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A lightweight Docker container for Go development based on Ubuntu 24.04.

```bash
esacteksab/go <none> 3d6df1c54b86 3 hours ago 335MB
esacteksab/go 1.25.8 f1f694493a08 2 minutes ago 445MB
golang 1.24.3-bookworm f254902cf370 2 days ago 853MB
```

Expand All @@ -14,15 +14,15 @@ This repository contains a Dockerfile and GitHub Actions workflow that creates a
## Container Details

- **Base Image:** Ubuntu 24.04
- **Go Version:** Configurable via repository variables `GO_VERSION=1.25.6`
- **Go Version:** Configurable via repository variables `GO_VERSION=1.25.8`
- **Registry:** [Docker Hub - esacteksab/go](https://hub.docker.com/r/esacteksab/go)
- **Build Schedule:** Every Friday at 9:00 AM Central Time (US/Chicago)

## Available Tags

- `latest` - The most recent build
- `1.25.6` (or current Go version) - Tagged with the specific Go version
- `1.25.6-YYYY-MM-DD` - Version with build date for historical reference
- `1.25.8` (or current Go version) - Tagged with the specific Go version
- `1.25.8-YYYY-MM-DD` - Version with build date for historical reference

## Features

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"prettier-plugin-sh": "^0.18.0",
"prettier-plugin-toml": "^2.0.6"
},
"packageManager": "pnpm@10.24.0"
"packageManager": "pnpm@10.32.0"
}