From 1c3f97a7e97adcd9e45cc16bdf219a15e5448db0 Mon Sep 17 00:00:00 2001 From: Gitouche <26656-gitouche@users.noreply.framagit.org> Date: Sat, 5 Mar 2022 10:30:15 +0100 Subject: [PATCH] Jitsi / Matrix : use /tmp buildfolder to uncompress archive --- podman-jitsi/zz_build-images.sh | 20 +++++++++++--------- podman-matrix/zz_build-images.sh | 12 +++++++----- podman-peerjs/zz_build-images.sh | 2 +- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/podman-jitsi/zz_build-images.sh b/podman-jitsi/zz_build-images.sh index 8e1d480..4d1f6c1 100755 --- a/podman-jitsi/zz_build-images.sh +++ b/podman-jitsi/zz_build-images.sh @@ -7,30 +7,32 @@ source ${ABSDIR}/vars.sh ensure_pwd_is_scriptdir ensure_not_root -mkdir docker-jitsi-meet && -curl -s -- "https://codeload.github.com/jitsi/docker-jitsi-meet/tar.gz/refs/tags/${version}" | tar xz --strip-components 1 -C docker-jitsi-meet/ && { +buildfolder=/tmp/docker-jitsi-meet-$$ + +mkdir ${buildfolder} && +curl -s -- "https://codeload.github.com/jitsi/docker-jitsi-meet/tar.gz/refs/tags/${version}" | tar xz --strip-components 1 -C ${buildfolder}/ && { podman pull docker.io/library/debian:bullseye-slim if ! podman image exists localhost/jitsi/base:${version}; then - podman build -t localhost/jitsi/base:${version} docker-jitsi-meet/base/ && + podman build -t localhost/jitsi/base:${version} ${buildfolder}/base/ && podman image tag localhost/jitsi/base:${version} localhost/jitsi/base:latest || exit -1 fi if ! podman image exists localhost/jitsi/base-java:${version}; then - podman build -t localhost/jitsi/base-java:${version} docker-jitsi-meet/base-java && + podman build -t localhost/jitsi/base-java:${version} ${buildfolder}/base-java && podman image tag localhost/jitsi/base-java:${version} localhost/jitsi/base-java:latest || exit -1 fi if ! podman image exists localhost/jitsi/jvb:${version}; then - podman build -t localhost/jitsi/jvb:${version} docker-jitsi-meet/jvb/ || exit -1 + podman build -t localhost/jitsi/jvb:${version} ${buildfolder}/jvb/ || exit -1 fi if ! podman image exists localhost/jitsi/jicofo:${version}; then - podman build -t localhost/jitsi/jicofo:${version} docker-jitsi-meet/jicofo/ || exit -1 + podman build -t localhost/jitsi/jicofo:${version} ${buildfolder}/jicofo/ || exit -1 fi if ! podman image exists localhost/jitsi/prosody:${version}; then - podman build -t localhost/jitsi/prosody:${version} docker-jitsi-meet/prosody/ || exit -1 + podman build -t localhost/jitsi/prosody:${version} ${buildfolder}/prosody/ || exit -1 fi if ! podman image exists localhost/jitsi/web:${version}; then - podman build -t localhost/jitsi/web:${version} docker-jitsi-meet/web/ || exit -1 + podman build -t localhost/jitsi/web:${version} ${buildfolder}/web/ || exit -1 podman rmi -f $(podman images -f "dangling=true" -q) fi podman rmi localhost/jitsi/base-java:${version} localhost/jitsi/base-java:latest podman rmi localhost/jitsi/base:${version} localhost/jitsi/base:latest -} ; rm -rf docker-jitsi-meet +} ; rm -rf ${buildfolder} diff --git a/podman-matrix/zz_build-images.sh b/podman-matrix/zz_build-images.sh index f671805..24918d7 100755 --- a/podman-matrix/zz_build-images.sh +++ b/podman-matrix/zz_build-images.sh @@ -7,16 +7,18 @@ source ${ABSDIR}/vars.sh ensure_pwd_is_scriptdir ensure_not_root +buildfolder=/tmp/synapse-$$ + if ! podman image exists localhost/matrixdotorg/synapse:${synapse_version}; then - mkdir synapse && - curl -s -- "https://codeload.github.com/matrix-org/synapse/tar.gz/refs/tags/${synapse_version}" | \tar xz --strip-components 1 -C synapse/ && { + mkdir ${buildfolder} && + curl -s -- "https://codeload.github.com/matrix-org/synapse/tar.gz/refs/tags/${synapse_version}" | \tar xz --strip-components 1 -C ${buildfolder}/ && { podman run -d --name buildkitd --privileged docker.io/moby/buildkit:latest && curl -sSLf https://github.com/moby/buildkit/releases/download/v0.9.3/buildkit-v0.9.3.linux-amd64.tar.gz | \ tar xz -C ~/ bin/buildctl && ~/bin/buildctl --addr=podman-container://buildkitd build \ --frontend dockerfile.v0 \ - --local context=synapse/ \ - --local dockerfile=synapse/docker/ \ + --local context=${buildfolder}/ \ + --local dockerfile=${buildfolder}/docker/ \ --output type=tar | \ podman import --change 'EXPOSE 8008/tcp' \ --change 'EXPOSE 8009/tcp' \ @@ -26,5 +28,5 @@ if ! podman image exists localhost/matrixdotorg/synapse:${synapse_version}; then podman rmi docker.io/moby/buildkit:latest && rm -f ~/bin/buildctl } - rm -rf synapse + rm -rf ${buildfolder} fi diff --git a/podman-peerjs/zz_build-images.sh b/podman-peerjs/zz_build-images.sh index bc5ae87..a1c96d1 100755 --- a/podman-peerjs/zz_build-images.sh +++ b/podman-peerjs/zz_build-images.sh @@ -10,7 +10,7 @@ ensure_not_root buildfolder=/tmp/peerjs-server-$$ if ! podman image exists ${upstream_images}:${version}; then - mkdir -p ${buildfolder} && + mkdir ${buildfolder} && curl -sSfL -- "https://github.com/peers/peerjs-server/archive/refs/tags/v${version}.tar.gz" | \tar xz --strip-components 1 -C ${buildfolder}/ && sed_in_place "^FROM node:alpine" "FROM docker.io/library/node:alpine" ${buildfolder}/Dockerfile podman build -t ${upstream_images}:${version} ${buildfolder}/