Skip to content

Commit ae5010f

Browse files
committed
Squashed commit of the following:
commit 0cd1d1b Author: Evan Darwin <edarwin@protonmail.com> Date: Fri Apr 18 23:53:45 2025 -0700 Update SBOM artifact retention period to 90 days commit bfc9a25 Author: Evan Darwin <edarwin@protonmail.com> Date: Fri Apr 18 23:30:05 2025 -0700 Update upload-artifact action to v4 and extend SBOM retention period to 365 days commit fa3ed42 Author: Evan Darwin <edarwin@protonmail.com> Date: Fri Apr 18 23:27:48 2025 -0700 Add Syft installation and SBOM generation to Docker workflow; update README for version 5.4.7 commit c22f9da Author: Evan Darwin <edarwin@protonmail.com> Date: Fri Apr 18 23:06:18 2025 -0700 Update GitHub Actions to use latest versions of checkout, Buildx, and login actions commit 3af6fcc Author: Evan Darwin <edarwin@protonmail.com> Date: Fri Apr 18 23:03:05 2025 -0700 Remove attestation configuration from Docker image workflow commit d29764a Author: Evan Darwin <edarwin@protonmail.com> Date: Fri Apr 18 23:02:32 2025 -0700 Test experimental new workflow commit a5a51d2 Author: Evan Darwin <edarwin@protonmail.com> Date: Fri Apr 18 23:01:02 2025 -0700 Remove obsolete Docker workflows and update Dockerfile to use dynamic Lua version commit 8f727f6 Author: Evan Darwin <edarwin@protonmail.com> Date: Fri Apr 18 22:55:31 2025 -0700 Update Lua and LuaRocks versions to 5.4.7 and 3.11.1 respectively commit 8e1cc76 Author: Evan Darwin <edarwin@protonmail.com> Date: Fri Apr 18 22:55:27 2025 -0700 Remove tag trigger from SBOM and Attestation workflow; restrict to master and ci-changes branches commit c4f20c8 Author: Evan Darwin <edarwin@protonmail.com> Date: Fri Apr 18 22:40:38 2025 -0700 Enhance Docker workflows with attestation and SBOM support; update README for security features and usage instructions
1 parent fa01c85 commit ae5010f

7 files changed

Lines changed: 134 additions & 22 deletions

File tree

.github/workflows/dockerimage-latest.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/dockerimage.yml

Lines changed: 69 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Lua Docker - Image CI
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [ master, ci-changes ]
66
pull_request:
77
branches: [ master ]
88

@@ -11,6 +11,71 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v2
15-
- name: Build the Docker image
16-
run: docker build . --file Dockerfile --tag evandarwin/lua:$(cat .lua.release)
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Docker Buildx
17+
uses: docker/setup-buildx-action@v3
18+
19+
- name: Configure Docker BuildKit
20+
run: |
21+
echo "DOCKER_BUILDKIT=1" >> $GITHUB_ENV
22+
23+
- name: Login to Docker Hub
24+
if: github.event_name != 'pull_request'
25+
uses: docker/login-action@v3
26+
with:
27+
username: ${{ secrets.DOCKER_USERNAME }}
28+
password: ${{ secrets.DOCKER_PASSWORD }}
29+
30+
- name: Extract version components
31+
id: version
32+
run: |
33+
FULL_VERSION=$(cat .lua.release)
34+
MAJOR_VERSION=$(echo $FULL_VERSION | cut -d'.' -f1)
35+
MAJOR_MINOR_VERSION=$(echo $FULL_VERSION | cut -d'.' -f1,2)
36+
37+
echo "full_version=$FULL_VERSION" >> $GITHUB_OUTPUT
38+
echo "major_version=$MAJOR_VERSION" >> $GITHUB_OUTPUT
39+
echo "major_minor_version=$MAJOR_MINOR_VERSION" >> $GITHUB_OUTPUT
40+
41+
- name: Install Syft for SBOM generation
42+
run: |
43+
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin
44+
45+
- name: Build and push
46+
uses: docker/build-push-action@v4
47+
with:
48+
context: .
49+
push: ${{ github.event_name != 'pull_request' }}
50+
tags: |
51+
evandarwin/lua:${{ steps.version.outputs.full_version }}
52+
evandarwin/lua:${{ steps.version.outputs.major_minor_version }}
53+
evandarwin/lua:${{ steps.version.outputs.major_version }}
54+
evandarwin/lua:latest
55+
provenance: true
56+
outputs: type=image,name=evandarwin/lua
57+
build-args: |
58+
BUILD_DATE=${{ github.event.repository.updated_at }}
59+
VCS_REF=${{ github.sha }}
60+
VERSION=${{ steps.version.outputs.full_version }}
61+
62+
- name: Generate SBOM
63+
if: github.event_name != 'pull_request'
64+
run: |
65+
# Create output directory
66+
mkdir -p sbom
67+
68+
# Generate SBOM in multiple formats
69+
syft evandarwin/lua:${{ steps.version.outputs.full_version }} -o spdx-json=sbom/spdx.json
70+
syft evandarwin/lua:${{ steps.version.outputs.full_version }} -o cyclonedx-json=sbom/cyclonedx.json
71+
72+
# Optional: Generate human-readable text version
73+
syft evandarwin/lua:${{ steps.version.outputs.full_version }} -o text=sbom/sbom.txt
74+
75+
- name: Upload SBOM as artifact
76+
if: github.event_name != 'pull_request'
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: sbom-files
80+
path: sbom/
81+
retention-days: 90

.lua.release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.4.6
1+
5.4.7

.luarocks.release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.9.2
1+
3.11.1

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"workbench.colorCustomizations": {
3+
"activityBar.background": "#540358",
4+
"titleBar.activeBackground": "#75057B",
5+
"titleBar.activeForeground": "#FFF9FF"
6+
}
7+
}

Dockerfile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
FROM alpine:latest
2+
3+
# Build arguments
4+
ARG BUILD_DATE
5+
ARG VCS_REF
6+
ARG VERSION
7+
8+
# Set metadata labels
9+
LABEL org.opencontainers.image.created="${BUILD_DATE}" \
10+
org.opencontainers.image.revision="${VCS_REF}" \
11+
org.opencontainers.image.version="${VERSION}" \
12+
org.opencontainers.image.authors="Evan Darwin <github@relta.net>" \
13+
org.opencontainers.image.url="https://github.com/evandarwin/lua-docker" \
14+
org.opencontainers.image.documentation="https://github.com/evandarwin/lua-docker/blob/master/README.md" \
15+
org.opencontainers.image.description="Lua with LuaRocks container image"
16+
217
ENV AUTHOR="Evan Darwin <github@relta.net>"
318

4-
ENV VERSION_LUA="5.4.6"
19+
ENV VERSION_LUA="${VERSION:-5.4.7}"
520
ENV VERSION_LUAROCKS="3.9.2"
621

722
RUN apk add --no-cache libc-dev readline readline-dev unzip make gcc coreutils wget && \

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,48 @@
22

33
<img src="docs/lua.png" alt="Lua for Docker" style="zoom:33%;" />
44

5+
A simple `alpine` docker image that includes the Lua runtime as well as [LuaRocks](https://luarocks.org/).
56

7+
## Features
68

7-
A simple `alpine` docker image that includes the Lua runtime as well as [LuaRocks](https://luarocks.org/).
9+
- Lua 5.4.7 runtime
10+
- LuaRocks 3.9.2 package manager
11+
- Based on Alpine Linux for a minimal footprint
12+
- Container attestation and SBOM support
13+
14+
## Available Tags
15+
16+
Several version tags are available for flexibility:
17+
18+
- `evandarwin/lua:5.4.7` - Specific version (e.g., 5.4.7)
19+
- `evandarwin/lua:5.4` - Major.Minor version (e.g., 5.4)
20+
- `evandarwin/lua:5` - Major version only (e.g., 5)
21+
- `evandarwin/lua:latest` - Latest stable release
22+
23+
We recommend using the specific version tag for production environments to ensure stability, while the less specific tags can be used for development or when you want to automatically get updates.
24+
25+
## Docker Image Security
26+
27+
This image includes supply chain security features:
28+
29+
### Attestations
30+
31+
The image build process includes:
32+
- Docker provenance attestation
33+
- Software Bill of Materials (SBOM)
34+
35+
## Usage
36+
37+
```bash
38+
# Pull a specific version
39+
docker pull evandarwin/lua:5.4.7
40+
41+
# Or use the major.minor version
42+
docker pull evandarwin/lua:5.4
43+
44+
# Run a Lua command
45+
docker run -it evandarwin/lua:5.4.7 lua -e "print('Hello from Lua!')"
46+
```
847

948
Have fun!
1049

0 commit comments

Comments
 (0)