Skip to content

Commit

Permalink
feat: add alpine-toolbox
Browse files Browse the repository at this point in the history
  • Loading branch information
prehor committed Jul 3, 2024
1 parent bfeea8a commit 96ebc2a
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
],
"dependencyDashboardTitle": "Renovate Dashboard 🤖",
"suppressNotifications": ["prEditedNotification", "prIgnoreNotification"],
"ignorePaths": ["apps/alpine-toolbox"],
"packageRules": [
{
"addLabels": ["renovate/container", "type/major"],
Expand Down
34 changes: 34 additions & 0 deletions apps/alpine-toolbox/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
ARG VERSION
FROM docker.io/library/alpine:${VERSION}

ARG TARGETPLATFORM
ARG VERSION
ARG CHANNEL

ENV CHARSET="UTF-8" \
LANG="en_US.UTF-8" \
TZ="Etc/UTC"

RUN \
mkdir /config \
&& \
adduser app -D -u 568 -g 568 -h /config \
&& \
chown 568:568 /config \
&& \
apk add --no-cache \
bash \
ca-certificates \
catatonit \
curl \
\
git \
grep \
less

COPY ./apps/alpine-toolbox/entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/usr/bin/catatonit", "--"]
CMD ["/entrypoint.sh"]

LABEL org.opencontainers.image.source="https://alpinelinux.org"
3 changes: 3 additions & 0 deletions apps/alpine-toolbox/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Alpine Linux Toolbox

[Alpine Linux](https://alpinelinux.org) Toolbox image.
9 changes: 9 additions & 0 deletions apps/alpine-toolbox/ci/latest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
version=$(
curl -s --fail -H "Content-Type: application/json" 'https://hub.docker.com/v2/repositories/library/alpine/tags/?page_size=1000' |
jq -r '.results|.[]|.name' |
grep -oP '^\d+\.\d+\.\d+$' |
sort -V -r |
head -1
)
printf "%s" "${version}"
9 changes: 9 additions & 0 deletions apps/alpine-toolbox/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# Uses /bin/bash if no command is given or the first argument is an option
if [[ ${#@} -eq 0 || ${1:0:1} == '-' ]]; then
set -- /bin/bash "$@"
fi

# Execute command
exec "$@"
9 changes: 9 additions & 0 deletions apps/alpine-toolbox/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
app: alpine-toolbox
semver: true
channels:
- name: stable
platforms: ["linux/amd64"]
stable: true
tests:
enabled: false

0 comments on commit 96ebc2a

Please sign in to comment.