17 Commits
v2 ... main

Author SHA1 Message Date
6b53431bf1 Force golangci-lint cache directory for running as action.
All checks were successful
Build container / BuildImage (push) Successful in 1m46s
2025-09-11 08:09:23 +05:00
fba4800284 Export required env vars for Go toolchain.
All checks were successful
Build container / BuildImage (push) Successful in 3m7s
2025-09-11 06:10:02 +05:00
eeb176d1e9 Update Debian to Trixie (13).
All checks were successful
Build container / BuildImage (push) Successful in 1m58s
2025-09-11 02:34:15 +05:00
e92a5252b8 Install Fyne dependencies. 2025-09-11 02:32:26 +05:00
e58503c20b Update versions in README.
All checks were successful
Build container / BuildImage (push) Successful in 1m36s
2025-09-09 18:09:00 +05:00
16bdf8cde4 Update to v5 and gitea actions (#1)
Reviewed-on: #1
Co-authored-by: Stanislav N. aka pztrn <pztrn@pztrn.name>
Co-committed-by: Stanislav N. aka pztrn <pztrn@pztrn.name>
2025-09-09 18:07:43 +05:00
ea9a6db5b4 Update software to latest versions.
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-09-21 23:59:52 +05:00
d830676408 Remove quotes from command run line.
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-07-20 10:28:46 +05:00
48dda3455b PATH definition and proper command line output.
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-07-20 00:03:21 +05:00
b4e9d9ec58 Try to use INPUT_COMMAND variable while at actions mode.
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-07-19 23:54:51 +05:00
4e1dc58611 More verbosive entrypoint.
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-07-19 23:30:31 +05:00
21040eaa65 Get rid of command-args separation.
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-07-19 23:19:23 +05:00
bf978b222b Fix args position.
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-07-19 15:28:35 +05:00
c7e5ae7513 Try to make it github/gitea actionable.
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-07-19 15:11:50 +05:00
b22fd7cdfc Remove "newer mac" line from README as it is invalid now.
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-07 21:18:00 +05:00
829167d269 Clarify multiarch support in README.
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-07 21:17:15 +05:00
6590e5bd40 Script for multiarch image.
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-07 21:13:47 +05:00
13 changed files with 132 additions and 17 deletions

View File

@@ -0,0 +1,27 @@
---
name: "Build container"
run-name: "Build container"
on:
push:
tags:
- "**"
jobs:
BuildImage:
runs-on: "ubuntu-22.04"
steps:
- name: "checkout source"
uses: actions/checkout@v4
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: code.pztrn.name
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64
tags: code.pztrn.name/containers/go-toolbox:${{ gitea.ref_name }}

View File

@@ -1,4 +1,4 @@
FROM debian:12.6-slim
FROM debian:13.1-slim
COPY . /src
RUN for file in $(find /src -type f -name "*.sh"); do chmod +x $file; done
@@ -17,3 +17,5 @@ RUN mkdir /home/container && chmod 0777 /home/container
ENV HOME=/home/container
ENV GOPATH=/home/container/go
ENV GOCACHE=/home/container/.cache
ENTRYPOINT ["/src/entrypoint.sh"]

View File

@@ -2,21 +2,29 @@
Docker image with everything you might need for developing apps in Go.
**Note that for newer mac hardware you have to use Docker Desktop or amd64 virtual machine in lima/other tools!**
Includes neccessary headers and development packages for Fyne.
## What's inside
Debian 12 (slim) is used as base image.
Debian 13 (slim) is used as base image.
| Binary | Version | Project | Repo |
| ----------------- | ------- | --------------- | ------------------------------------------------------------- |
| `go` | 1.22.5 | Go | |
| `golangci-lint` | 1.59.1 | golangci-lint | [External link](https://github.com/golangci/golangci-lint) |
| `gofumpt` | 0.6.0 | gofumpt | [External link](https://github.com/mvdan/gofumpt) |
| `mockery_v2` | 2.43.2 | mockery | [External link](https://github.com/vektra/mockery) |
| `task` | 3.38.0 | taskfile | [External link](https://github.com/go-task/task) |
| ----------------- | ------- | --------------- | ------------------------------------------------------------ |
| `go` | 1.25.1 | Go | |
| `golangci-lint` | 2.4.0 | golangci-lint | [External link](https://github.com/golangci/golangci-lint) |
| `gofumpt` | 0.9.0 | gofumpt | [External link](https://github.com/mvdan/gofumpt) |
| `mockery_v2` | 2.53.4 | mockery | [External link](https://github.com/vektra/mockery) |
| `task` | 3.44.1 | taskfile | [External link](https://github.com/go-task/task) |
| `go-junit-report` | 2.1.0 | go-junit-report | [External link](https://github.com/jstemmer/go-junit-report) |
| `delve` | 1.22.1 | delve | [External link](https://github.com/go-delve/delve) |
| `delve` | 1.25.2 | delve | [External link](https://github.com/go-delve/delve) |
## Multiarch support
This image contains versions for both amd64 (AMD/Intel CPUs and their clones) and arm64 (Rockchips, Apple Silicon and so on).
Note, that **amd64** image built on my CI server, while **arm64** image I building on my local machine with `built_multiarch.sh`
for each published tag. It is because I have no separate arm64 machine (yet) and it's emulation on my server's CPU is freaking
slow (imagine Linux installation is going for three whole hours!).
## HOME

14
action.yml Normal file
View File

@@ -0,0 +1,14 @@
# action.yml
name: "Go Toolbox"
description: "A toolbox for golang applications development."
author: "Stanislav N. aka pztrn"
inputs:
command:
description: "Command to run."
required: true
default: "task -l"
runs:
using: "docker"
image: "Dockerfile"
args:
- ${{ inputs.command }}

30
build_multiarch.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# This script builds arm64 toolbox image, pushes it to packages and create version manifest with
# both amd64 and arm64 images.
# This script is launched on my local machine (which is macbook with M2 Pro CPU) and uses
# lima with arm64 version of Docker.
IMAGE_NAME="code.pztrn.name/containers/go-toolbox"
VERSION=$1
if [ "${VERSION}" == "" ]; then
echo "! No version specified as first argument!"
exit 1
fi
echo "* Building multiarch image with amd64 and arm64 images for version '${VERSION}'..."
echo "* Pulling ${IMAGE_NAME}:${VERSION} (amd64)..."
docker pull "${IMAGE_NAME}:${VERSION}"
echo "* Retagging pulled image as ${IMAGE_NAME}:${VERSION}-amd64..."
docker image tag "${IMAGE_NAME}:${VERSION}" "${IMAGE_NAME}:${VERSION}-amd64"
echo "* Pushing ${IMAGE_NAME}:${VERSION}-amd64..."
docker push "${IMAGE_NAME}:${VERSION}-amd64"
echo "* Building arm64 version..."
docker build -t "${IMAGE_NAME}:${VERSION}-arm64" .
echo "* Pushing arm64 image..."
docker push "${IMAGE_NAME}:${VERSION}-arm64"
echo "* Creating multiarch manifest..."
docker manifest create "${IMAGE_NAME}:${VERSION}" "${IMAGE_NAME}:${VERSION}-amd64" "${IMAGE_NAME}:${VERSION}-arm64"
echo "* Pushing multiarch manifest as ${IMAGE_NAME}:${VERSION}..."
docker manifest push "${IMAGE_NAME}:${VERSION}"

31
entrypoint.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
# Entrypoint that handles both GitHub/Gitea actions things and direct commands execution.
CMD=$*
# Just ensure we have PATH defined properly.
PATH="${PATH}:/usr/bin/:/usr/sbin/:/bin/:/usr/local/bin/:/opt/bin/"
# Also make sure that Go's environment variables are set.
export GOCACHE=/home/container/go/build
export GOMODCACHE=/home/container/go/pkg/mod
export GOPATH=/home/container/go
# ...and golangci-lint also!
export GOLANGCI_LINT_CACHE=/home/container/golangci-lint
if [ "${CMD}" == "" ]; then
CMD="${INPUT_COMMAND}"
fi
if [ "${CMD}" == "" ]; then
echo "! No command to run!"
exit 1
fi
echo "----------"
echo "Launching command:"
echo "${CMD}"
echo "----------"
${CMD}

View File

@@ -2,3 +2,6 @@
apt update && apt upgrade -y
apt install -y build-essential curl file git make
# Fyne dependencies.
apt install -y libgl1-mesa-dev xorg-dev libxkbcommon-dev

View File

@@ -1,6 +1,6 @@
#!/bin/bash
dlv_version=1.22.1
dlv_version=1.25.2
set -xe

View File

@@ -1,6 +1,6 @@
#!/bin/bash
gofumpt_version="0.6.0"
gofumpt_version="0.9.0"
set -xe

View File

@@ -6,7 +6,7 @@
set -xe
go_version=1.22.5
go_version=1.25.1
# shellcheck disable=SC2086,SC2046,SC2164
cd $(dirname ${BASH_SOURCE[0]})

View File

@@ -4,7 +4,7 @@
# Line above disables shellcheck linters:
# * SC2154 - variable referenced but not assigned (false positive, assigned when sourced arch.sh).
golangci_lint_version=1.59.1
golangci_lint_version=2.4.0
# shellcheck disable=SC2086,SC2046,SC2164
cd "$(dirname ${BASH_SOURCE[0]})"

View File

@@ -1,6 +1,6 @@
#!/bin/bash
mockery_v2_version=2.43.2
mockery_v2_version=2.53.4
cd /tmp || exit 1

View File

@@ -4,7 +4,7 @@
# Line above disables shellcheck linters:
# * SC2154 - variable referenced but not assigned (false positive, assigned when sourced arch.sh).
taskfile_version=3.38.0
taskfile_version=3.44.1
# shellcheck disable=SC2086,SC2046,SC2164
cd "$(dirname ${BASH_SOURCE[0]})"