buildx, asterisk

This commit is contained in:
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 # install packages
RUN apk add --no-cache tini bind RUN apk add --no-cache tini bind
RUN rm -fr /var/cache/apk/*
# execute # execute
ENTRYPOINT ["/sbin/tini", "--"] ENTRYPOINT ["/sbin/tini", "--"]

View file

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

View file

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

View file

@ -1,4 +1,4 @@
FROM alpine:3.19 FROM alpine
# set environment # set environment
ENV LANG en_US.UTF-8 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 # install packages
RUN apk add --no-cache tini wget openjdk21-jre jq curl shadow fontconfig ttf-dejavu RUN apk add --no-cache tini wget openjdk21-jre jq curl shadow fontconfig ttf-dejavu
RUN rm -fr /var/cache/apk/*
# copy scripts # copy scripts
COPY ./mcjar /usr/local/bin/mcjar COPY ./mcjar /usr/local/bin/mcjar