buildah.sh 724 B

12345678910111213141516171819202122232425
  1. #! /usr/bin/env bash
  2. DOCKER_BASE=python:3.10.8-alpine3.16
  3. ctr=$(buildah from docker.io/${DOCKER_BASE})
  4. mnt=$(buildah mount "$ctr")
  5. mkdir $mnt/znc/
  6. cp -r src/ $mnt/znc/
  7. cp -r plugins/ $mnt/znc/
  8. cp -r zeronet.py $mnt/znc/
  9. cp -r container-run-with-tor.sh $mnt/znc/
  10. cp -r requirements.txt $mnt/znc/
  11. buildah run $ctr apk add tor gcc libffi-dev musl-dev make openssl g++
  12. buildah run $ctr python3 -m pip install -r /znc/requirements.txt
  13. # reproducibility: erase date from all the copied/installed files
  14. find $mnt/ -exec touch -d @1669459000 -m {} +
  15. buildah umount "$ctr"
  16. # buildah config --entrypoint '["/znc/container-run-with-tor.sh"]' --cmd '' "$ctr"
  17. buildah commit --timestamp 1669459000 "$ctr" znc-tmp
  18. buildah rm "$ctr"