Compare commits

...

20 Commits

Author SHA1 Message Date
59f5178cb6 Add RUNNING_IN_DOCKER env variable
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-02-11 18:25:21 -08:00
25d24eb8d4 Update busybox-root/README.md
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2024-03-12 21:54:02 +00:00
286cfaea5d Set correct image names
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2024-03-12 14:51:51 -07:00
66dbde0979 Add static-root and busybox-root containers
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2024-03-12 14:50:24 -07:00
57114a0a13 Update LURE in builder image
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-10-08 17:37:58 -07:00
d2a7861da9 Update README [skip ci] 2023-09-28 16:46:33 +00:00
0b3613c74e Set the go version tag manually
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-09-28 06:26:21 +00:00
0f76c06081 Clarify README
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/manual/woodpecker Pipeline was successful
2023-08-16 13:47:48 -07:00
c980a6a607 Clarify crane README
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-08-16 13:02:51 -07:00
66ebc83e3a Add entrypoint to busybox image
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-08-16 12:59:30 -07:00
90949b12a5 Add new images to README 2023-08-16 12:58:44 -07:00
108e3e2949 Add crane image
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-08-16 12:25:36 -07:00
8d3fe838bb Add busybox image
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-08-16 12:21:13 -07:00
48f8374e21 Add ca-certificates to node image
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-08-16 12:07:45 -07:00
34d9723f3b Remove nonroot user from node image
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-08-16 12:04:23 -07:00
f2b4e9902a Add npm to the node image and upgrade to nodejs-current
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-08-16 12:03:01 -07:00
1d224f278b Add a node image
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-08-15 20:30:35 -07:00
263ead47f7 Add a way to force build a container
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-08-15 13:11:51 -07:00
6923695bb5 Add version tag to golang
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-08-14 22:48:26 -07:00
47c9a346a2 Add yq to builder image 2023-08-14 22:44:40 -07:00
20 changed files with 142 additions and 4 deletions

View File

@@ -2,7 +2,7 @@
[![status-badge](https://ci.elara.ws/api/badges/51/status.svg)](https://ci.elara.ws/repos/51)
This repo contains custom docker images that I'm using for my cluster. You can find the containers I build from these in the [Packages](https://gitea.elara.ws/Elara6331/riscv-docker/packages) section of this repo.
This repo contains build scripts for custom docker images that I'm using for my cluster. You can find the containers that are automatically built from these in the [Packages](https://gitea.elara.ws/Elara6331/riscv-docker/packages) section of this repo.
The containers are stored on my gitea instance, so you can pull them like this:
@@ -10,12 +10,17 @@ The containers are stored on my gitea instance, so you can pull them like this:
docker pull gitea.elara.ws/elara6331/golang:latest
```
Read my article [here](https://www.elara.ws/articles/riscv-cluster)!
### Images
- `static`: A base image with just enough files to run static binaries
- `busybox`: A base image with the busybox utilities installed
- `golang`: An alpine-based image with Go installed
- `webserver`: A very simple webserver
- `go-import-redirector`: rsc's [go-import-redirector](https://github.com/rsc/go-import-redirector) project
- `node`: An alpine-based image with NodeJS and npm installed
- `crane`: Google's [crane](https://github.com/google/go-containerregistry/tree/main/cmd/crane) project
### Acknowledgements

View File

@@ -33,6 +33,11 @@ for file in $changed_files; do
fi
done
# Check if FORCE_BUILD is set and add the directory inside to changed_directories if it is
if [ -n "${FORCE_BUILD}" ]; then
changed_directories["${FORCE_BUILD}"]=1
fi
if [[ "${#changed_directories[@]}" == 0 ]]; then
info "Nothing to do. Exiting..."
exit 0

View File

@@ -1,7 +1,10 @@
FROM alpine:edge
RUN apk add --no-cache go git gcc bash abuild
RUN apk add --no-cache go yq git gcc bash abuild
RUN apk add --no-cache ko --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
RUN apk add --no-cache --allow-untrusted apko --repository=https://packages.wolfi.dev/os
RUN wget -O /usr/bin/lure https://api.minio.elara.ws/adl/lure/lure-amd64 && chmod +x /usr/bin/lure
RUN wget -O lure.tar.gz https://gitea.elara.ws/lure/lure/releases/download/v0.1.2/lure-0.1.2-linux-x86_64.tar.gz && \
tar xvf lure.tar.gz && \
install -Dm755 lure /usr/bin/lure && \
rm -r lure scripts
COPY lure.toml /root/.config/lure/lure.toml
COPY login.sh /bin/registry-login

5
busybox-root/README.md Normal file
View File

@@ -0,0 +1,5 @@
# busybox-root
The [busybox-root image](https://gitea.elara.ws/Elara6331/-/packages/container/busybox-root/latest) is a basic image with the busybox utilities installed.
This image runs as root. See [busybox](https://gitea.elara.ws/Elara6331/riscv-docker/src/branch/master/busybox) for a rootless container.

9
busybox-root/apko.yaml Normal file
View File

@@ -0,0 +1,9 @@
include: gitea.elara.ws/elara6331/riscv-docker/static-root/apko.yaml@master
contents:
packages:
- busybox
- ssl_client
entrypoint:
command: /bin/sh

3
busybox-root/build.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
set -e
apko publish --sbom=false apko.yaml gitea.elara.ws/elara6331/busybox-root:latest

3
busybox/README.md Normal file
View File

@@ -0,0 +1,3 @@
# busybox
The [busybox image](https://gitea.elara.ws/Elara6331/-/packages/container/busybox/latest) is a basic image with the busybox utilities installed.

9
busybox/apko.yaml Normal file
View File

@@ -0,0 +1,9 @@
include: gitea.elara.ws/elara6331/riscv-docker/static/apko.yaml@master
contents:
packages:
- busybox
- ssl_client
entrypoint:
command: /bin/sh

4
busybox/build.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
set -e
apko publish --sbom=false apko.yaml gitea.elara.ws/elara6331/busybox:latest

3
crane/README.md Normal file
View File

@@ -0,0 +1,3 @@
# crane
The [crane](https://gitea.elara.ws/Elara6331/-/packages/container/crane/latest) image contains Google's [crane](https://github.com/google/go-containerregistry/tree/main/cmd/crane) project. It comes with `/bin/sh` unlike Google's official image, so it's useful for programs such as Woodpecker CI, which depend on a shell being available.

17
crane/build.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
set -e
# Clone go-containerregistry and enter crane's directory
git clone --depth=1 https://github.com/google/go-containerregistry.git
pushd go-containerregistry/cmd/crane
# Build and publish the image
KO_DOCKER_REPO=gitea.elara.ws/elara6331 \
KO_DEFAULTBASEIMAGE=gitea.elara.ws/elara6331/busybox \
ko build -B \
--platform=linux/amd64,linux/arm64,linux/riscv64 \
--sbom=none
# Leave crane's directory
popd

View File

@@ -20,4 +20,4 @@ for arch in pkgs/*/; do
abuild-sign "$arch/APKINDEX.tar.gz"
done
apko publish --sbom=false apko.yaml gitea.elara.ws/elara6331/golang:latest
apko publish --sbom=false apko.yaml gitea.elara.ws/elara6331/golang:latest gitea.elara.ws/elara6331/golang:1.21.1

3
node/README.md Normal file
View File

@@ -0,0 +1,3 @@
# node
The [node image](https://gitea.elara.ws/Elara6331/-/packages/container/node/latest) is an Alpine Edge image with the latest version of NodeJS from Alpine's [nodejs package](https://pkgs.alpinelinux.org/package/edge/main/riscv64/nodejs) installed

32
node/apko.yaml Normal file
View File

@@ -0,0 +1,32 @@
contents:
repositories:
- https://dl-cdn.alpinelinux.org/alpine/edge/main
- https://dl-cdn.alpinelinux.org/alpine/edge/community
packages:
- busybox
- alpine-release
- ca-certificates-bundle
- nghttp2
- nodejs-current
- npm
paths:
- path: /app
type: directory
permissions: 0o777
work-dir: /app
environment:
NODE_PORT: 3000
PATH: '/usr/sbin:/sbin:/usr/bin:/bin'
NPM_CONFIG_UPDATE_NOTIFIER: false
entrypoint:
command: /usr/bin/node
cmd: --help
archs:
- amd64
- arm64
- riscv64

7
node/build.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
set -e
apko publish \
--sbom=false \
--package-version-tag=nodejs-current \
apko.yaml \
gitea.elara.ws/elara6331/node:latest

7
static-root/README.md Normal file
View File

@@ -0,0 +1,7 @@
# static-root
The [static-root image](https://gitea.elara.ws/Elara6331/-/packages/container/static-root/latest) is a basic image with just enough files to run static binaries. It's meant to be used as a base image and is useless outside of that.
This image will only run static binaries (i.e. Go binaries with `CGO_ENABLED=0`) as it doesn't include musl or glibc
This image runs as root. See [static](https://gitea.elara.ws/Elara6331/riscv-docker/src/branch/master/static) for a rootless container.

16
static-root/apko.yaml Normal file
View File

@@ -0,0 +1,16 @@
contents:
repositories:
- https://dl-cdn.alpinelinux.org/alpine/edge/main
packages:
- alpine-baselayout-data
- alpine-release
- ca-certificates-bundle
- tzdata
environment:
RUNNING_IN_DOCKER: true
archs:
- amd64
- arm64
- riscv64

3
static-root/build.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
set -e
apko publish --sbom=false apko.yaml gitea.elara.ws/elara6331/static-root:latest

View File

@@ -17,6 +17,9 @@ accounts:
gid: 65532
run-as: 65532
environment:
RUNNING_IN_DOCKER: true
archs:
- amd64
- arm64

View File

@@ -1,3 +1,4 @@
#!/bin/bash
set -e
apko publish --sbom=false apko.yaml gitea.elara.ws/elara6331/static:latest