buildx, asterisk

This commit is contained in:
Freya Murphy 2024-06-06 21:30:12 -04:00
parent dc940d4afe
commit 04b1b8d4fc
Signed by: freya
GPG key ID: 744AB800E383AE52
6 changed files with 50 additions and 19 deletions

13
asterisk/Dockerfile Normal file
View file

@ -0,0 +1,13 @@
FROM alpine
# install packages
RUN apk add --no-cache tini asterisk
# volume
RUN mkdir -p /etc/asterisk
VOLUME /etc/asterisk
# execute
USER asterisk
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/usr/sbin/asterisk", "-fi"]

7
asterisk/README.md Normal file
View file

@ -0,0 +1,7 @@
### images/asterisk
runs the asterisk pbx server
#### config
the config is loaded from /etc/asterisk, put a volume there if you want to do things

View file

@ -1,8 +1,7 @@
FROM alpine:3.19
FROM alpine
# install packages
RUN apk add --no-cache tini bind
RUN rm -fr /var/cache/apk/*
# execute
ENTRYPOINT ["/sbin/tini", "--"]

View file

@ -1,21 +1,35 @@
#!/bin/sh
set -e
remote="g.freya.cat"
user="freya"
architectures="linux/amd64,linux/arm64"
init() {
docker login "$remote" -u "$user"
build() {
image="$(echo "$1" | tr -d './')"
echo "building $image"
docker build "$image" -t "$remote/$user/$image:latest"
docker push "$remote/$user/$image"
current="$(docker buildx inspect | head -n 1 | awk '{ print $2 }')"
if [ "$current" != "builder" ]; then
docker buildx create --name builder
docker buildx use builder
fi
}
build() {
docker buildx build --push --platform "$architectures" "$image" -t "$remote/$user/$image:latest"
}
build_all() {
images="$(find . -mindepth 1 -maxdepth 1 -type d | grep -v '\./\.' | tr -d './')"
IFS=$'\n'
for image in $images; do
build "$image"
done
}
init
if [ "$#" -gt 0 ]; then
build "$1"
else
images="$(find . -mindepth 1 -type d \( -name '.*' -prune -o -print \))"
IFS=$'\n'
for image in $images; do build "$image"; done;
build_all
fi

View file

@ -1,8 +1,7 @@
FROM alpine:3.19
FROM alpine
# install packages
RUN apk add --no-cache tini wget
RUN rm -fr /var/cache/apk/*
# copy entrypoint
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh

View file

@ -1,4 +1,4 @@
FROM alpine:3.19
FROM alpine
# set environment
ENV LANG en_US.UTF-8
@ -7,7 +7,6 @@ ENV PATH=/usr/lib/jvm/java-21-openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sb
# install packages
RUN apk add --no-cache tini wget openjdk21-jre jq curl shadow fontconfig ttf-dejavu
RUN rm -fr /var/cache/apk/*
# copy scripts
COPY ./mcjar /usr/local/bin/mcjar