Commandes podman : invocation explicite container/image
This commit is contained in:
parent
93c1f9cd8e
commit
69adeb772c
|
@ -9,11 +9,11 @@ ensure_not_root
|
||||||
|
|
||||||
echo "Podman images status..."
|
echo "Podman images status..."
|
||||||
for image in ${upstream_images} ; do
|
for image in ${upstream_images} ; do
|
||||||
podman images ${image} | grep ${image} || echo Image ${image} not found.
|
podman image list ${image} | grep ${image} || echo Image ${image} not found.
|
||||||
done
|
done
|
||||||
echo
|
echo
|
||||||
echo "Checking container status..."
|
echo "Checking container status..."
|
||||||
podman ps -a | grep ${container_name} || echo container ${container_name} not found.
|
podman container list -a | grep ${container_name} || echo container ${container_name} not found.
|
||||||
echo
|
echo
|
||||||
echo "Checking systemd unit status..."
|
echo "Checking systemd unit status..."
|
||||||
systemctl --user status ${service_name}
|
systemctl --user status ${service_name}
|
||||||
|
|
|
@ -9,7 +9,7 @@ ensure_not_root
|
||||||
|
|
||||||
echo "Podman images status..."
|
echo "Podman images status..."
|
||||||
for image in ${upstream_images} ; do
|
for image in ${upstream_images} ; do
|
||||||
podman images ${image} | grep ${image} || echo Image ${image} not found.
|
podman image list ${image} | grep ${image} || echo Image ${image} not found.
|
||||||
done
|
done
|
||||||
echo
|
echo
|
||||||
echo "Checking pod status..."
|
echo "Checking pod status..."
|
||||||
|
|
|
@ -21,10 +21,10 @@ if check_systemd_unit_exists ${service_name}; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if running through podman (no systemd), stop with podman stop , then exit
|
# Check if running through podman (no systemd), stop with podman container stop , then exit
|
||||||
if check_container_running ${container_name}; then
|
if check_container_running ${container_name}; then
|
||||||
echo Container found running without systemd unit, stopping it now.
|
echo Container found running without systemd unit, stopping it now.
|
||||||
podman stop ${container_name}
|
podman container stop ${container_name}
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo Container ${container_name} is not running.
|
echo Container ${container_name} is not running.
|
||||||
|
|
|
@ -21,7 +21,7 @@ if check_systemd_unit_exists ${service_name}; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if running through podman (no systemd), stop with podman stop , then exit
|
# Check if running through podman (no systemd), stop with podman pod stop , then exit
|
||||||
if check_pod_running ${pod_name}; then
|
if check_pod_running ${pod_name}; then
|
||||||
echo Pod found running without systemd unit, stopping it now.
|
echo Pod found running without systemd unit, stopping it now.
|
||||||
podman pod stop ${pod_name}
|
podman pod stop ${pod_name}
|
||||||
|
|
|
@ -17,7 +17,7 @@ ${ABSDIR}/70_disable.sh
|
||||||
|
|
||||||
rm -f ${HOME}/.config/systemd/user/${service_name}
|
rm -f ${HOME}/.config/systemd/user/${service_name}
|
||||||
systemctl --user daemon-reload
|
systemctl --user daemon-reload
|
||||||
podman rm ${container_name}
|
podman container rm ${container_name}
|
||||||
|
|
||||||
for volume in ${nonpersistent_volumes}; do
|
for volume in ${nonpersistent_volumes}; do
|
||||||
podman volume rm ${volume}
|
podman volume rm ${volume}
|
||||||
|
|
|
@ -18,5 +18,5 @@ ensure_systemd_unit_not_exists ${service_name}
|
||||||
|
|
||||||
# remove images
|
# remove images
|
||||||
for image in ${upstream_images} ; do
|
for image in ${upstream_images} ; do
|
||||||
podman rmi -f $(podman images -a -q -- ${image}) || echo Image ${image} not found.
|
podman image rm -f $(podman image list -a -q -- ${image}) || echo Image ${image} not found.
|
||||||
done
|
done
|
||||||
|
|
|
@ -18,5 +18,5 @@ ensure_systemd_unit_not_exists ${service_name}
|
||||||
|
|
||||||
# remove images
|
# remove images
|
||||||
for image in ${upstream_images} ; do
|
for image in ${upstream_images} ; do
|
||||||
podman rmi -f $(podman images -a -q -- ${image}) || echo Image ${image} not found.
|
podman image rm -f $(podman image list -a -q -- ${image}) || echo Image ${image} not found.
|
||||||
done
|
done
|
||||||
|
|
|
@ -311,9 +311,9 @@ oci_push_to_registry () {
|
||||||
if ! skopeo inspect --format "Image ${1} found on remote container registry." docker://${1}; then
|
if ! skopeo inspect --format "Image ${1} found on remote container registry." docker://${1}; then
|
||||||
if podman image exists ${1}; then
|
if podman image exists ${1}; then
|
||||||
ensure_variables_are_defined "CONTAINER_REPO_USER CONTAINER_REPO_PASSWORD"
|
ensure_variables_are_defined "CONTAINER_REPO_USER CONTAINER_REPO_PASSWORD"
|
||||||
podman push --creds=${CONTAINER_REPO_USER}:${CONTAINER_REPO_PASSWORD} ${1} &&
|
podman image push --creds=${CONTAINER_REPO_USER}:${CONTAINER_REPO_PASSWORD} ${1} &&
|
||||||
podman image rm ${1} &&
|
podman image rm ${1} &&
|
||||||
podman pull ${1}
|
podman image pull ${1}
|
||||||
else
|
else
|
||||||
echo "Error : image ${1} does not exists"
|
echo "Error : image ${1} does not exists"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -34,13 +34,13 @@ export listen_if
|
||||||
export listen_port
|
export listen_port
|
||||||
|
|
||||||
if ! podman image exists ${framadate_image}:${framadate_version}; then
|
if ! podman image exists ${framadate_image}:${framadate_version}; then
|
||||||
podman pull ${framadate_image}:${framadate_version}
|
podman image pull ${framadate_image}:${framadate_version}
|
||||||
fi
|
fi
|
||||||
podman pull ${mysql_image}:${mysql_version} &&
|
podman image pull ${mysql_image}:${mysql_version} &&
|
||||||
|
|
||||||
podman-compose --pod-args="--infra=true --infra-name=${project_name}_infra --share=" --podman-run-args "--requires=${project_name}_infra --env-file .env" up -d &&
|
podman-compose --pod-args="--infra=true --infra-name=${project_name}_infra --share=" --podman-run-args "--requires=${project_name}_infra --env-file .env" up -d &&
|
||||||
echo -n "Waiting for initialization to end... " &&
|
echo -n "Waiting for initialization to end... " &&
|
||||||
( podman logs -f framadate-app 2>&1 & ) | grep -q 'configured -- resuming normal operations' &&
|
( podman container logs -f framadate-app 2>&1 & ) | grep -q 'configured -- resuming normal operations' &&
|
||||||
echo "OK" &&
|
echo "OK" &&
|
||||||
shred -u .env &&
|
shred -u .env &&
|
||||||
podman pod stop ${pod_name}
|
podman pod stop ${pod_name}
|
||||||
|
|
|
@ -8,7 +8,7 @@ ensure_pwd_is_scriptdir
|
||||||
ensure_not_root
|
ensure_not_root
|
||||||
|
|
||||||
if ! podman image exists ${framadate_image}:${framadate_version}; then
|
if ! podman image exists ${framadate_image}:${framadate_version}; then
|
||||||
podman build -t "${framadate_image}":"${framadate_version}" --build-arg=version="${framadate_version}" docker/
|
podman image build -t "${framadate_image}":"${framadate_version}" --build-arg=version="${framadate_version}" docker/
|
||||||
else
|
else
|
||||||
echo "Image ${framadate_image}:${framadate_version} already built"
|
echo "Image ${framadate_image}:${framadate_version} already built"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -54,14 +54,14 @@ export sshlisten_port
|
||||||
if ! podman image exists ${gitea_image}:${gitea_version}; then
|
if ! podman image exists ${gitea_image}:${gitea_version}; then
|
||||||
podman image pull ${gitea_image}:${gitea_version} || exit 1
|
podman image pull ${gitea_image}:${gitea_version} || exit 1
|
||||||
fi
|
fi
|
||||||
podman pull ${postgres_image}:${postgres_version} &&
|
podman image pull ${postgres_image}:${postgres_version} &&
|
||||||
# force refresh of app.ini
|
# force refresh of app.ini
|
||||||
podman unshare rm -f `get_podman_volume_path ${datavolume}`/gitea/conf/app.ini
|
podman unshare rm -f `get_podman_volume_path ${datavolume}`/gitea/conf/app.ini
|
||||||
podman-compose --pod-args="--infra=true --infra-name=${project_name}_infra --share=" --podman-run-args "--requires=${project_name}_infra --env-file .env" up -d &&
|
podman-compose --pod-args="--infra=true --infra-name=${project_name}_infra --share=" --podman-run-args "--requires=${project_name}_infra --env-file .env" up -d &&
|
||||||
echo -n "Waiting for gitea to finish starting " &&
|
echo -n "Waiting for gitea to finish starting " &&
|
||||||
( podman logs -f ${container_name} 2>&1 & ) | grep -q 'NewServer()' &&
|
( podman container logs -f ${container_name} 2>&1 & ) | grep -q 'NewServer()' &&
|
||||||
echo "OK" &&
|
echo "OK" &&
|
||||||
podman exec --user 1000:1000 gitea gitea embedded extract --overwrite --destination /data/gitea/ 'templates/home.tmpl'
|
podman container exec --user 1000:1000 gitea gitea embedded extract --overwrite --destination /data/gitea/ 'templates/home.tmpl'
|
||||||
podman unshare sed -i '/{{.locale.Tr \"startpage.app_desc\"}}/,${s//Plateforme collaborative de projets libres./;b};$q1' `get_podman_volume_path ${datavolume}`/gitea/templates/home.tmpl &&
|
podman unshare sed -i '/{{.locale.Tr \"startpage.app_desc\"}}/,${s//Plateforme collaborative de projets libres./;b};$q1' `get_podman_volume_path ${datavolume}`/gitea/templates/home.tmpl &&
|
||||||
podman unshare sed -i '/{{.locale.Tr \"startpage.install\"}}/,${s//Qui peut avoir un compte ?/;b};$q1' `get_podman_volume_path ${datavolume}`/gitea/templates/home.tmpl &&
|
podman unshare sed -i '/{{.locale.Tr \"startpage.install\"}}/,${s//Qui peut avoir un compte ?/;b};$q1' `get_podman_volume_path ${datavolume}`/gitea/templates/home.tmpl &&
|
||||||
podman unshare sed -i '/{{.locale.Tr \"startpage.install_desc\" | Str2html}}/,${s//Tous ceux qui partagent de près ou de loin nos idées ou notre vision./;b};$q1' `get_podman_volume_path ${datavolume}`/gitea/templates/home.tmpl &&
|
podman unshare sed -i '/{{.locale.Tr \"startpage.install_desc\" | Str2html}}/,${s//Tous ceux qui partagent de près ou de loin nos idées ou notre vision./;b};$q1' `get_podman_volume_path ${datavolume}`/gitea/templates/home.tmpl &&
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
## Notes
|
## Notes
|
||||||
Pour ajouter un utilisateur (premier compte admin ou si la création de comptes est désactivée) :
|
Pour ajouter un utilisateur (premier compte admin ou si la création de comptes est désactivée) :
|
||||||
```
|
```
|
||||||
podman exec --user git gitea gitea admin user create --admin --username <name> --password <password> --email <email>
|
podman container exec --user git gitea gitea admin user create --admin --username <name> --password <password> --email <email>
|
||||||
```
|
```
|
||||||
Vérification de la bonne santé de l'instance, à faire après chaque mise à jour :
|
Vérification de la bonne santé de l'instance, à faire après chaque mise à jour :
|
||||||
```
|
```
|
||||||
podman exec --user git gitea gitea doctor --all --log-file ""
|
podman container exec --user git gitea gitea doctor --all --log-file ""
|
||||||
```
|
```
|
||||||
[Config cheat sheet](https://docs.gitea.io/en-us/config-cheat-sheet/)
|
[Config cheat sheet](https://docs.gitea.io/en-us/config-cheat-sheet/)
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@ if ! podman image exists ${gitea_image}:${gitea_version}; then
|
||||||
rm -rf ${buildfolder}
|
rm -rf ${buildfolder}
|
||||||
podman image prune -a -f --filter dangling=true
|
podman image prune -a -f --filter dangling=true
|
||||||
podman image prune -a -f --filter intermediate=true
|
podman image prune -a -f --filter intermediate=true
|
||||||
podman image rm -f $(podman images -a -q -- docker.io/library/golang)
|
podman image rm -f $(podman image list -a -q -- docker.io/library/golang)
|
||||||
podman image rm -f $(podman images -a -q -- docker.io/library/alpine)
|
podman image rm -f $(podman image list -a -q -- docker.io/library/alpine)
|
||||||
else
|
else
|
||||||
echo "Image ${gitea_image}:${gitea_version} already built"
|
echo "Image ${gitea_image}:${gitea_version} already built"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -85,7 +85,7 @@ if ! podman image exists ${database_image}:${database_version}; then
|
||||||
fi
|
fi
|
||||||
podman-compose --pod-args="--infra=true --infra-name=${project_name}_infra --share=" --podman-run-args "--requires=${project_name}_infra --env-file .env" up -d &&
|
podman-compose --pod-args="--infra=true --infra-name=${project_name}_infra --share=" --podman-run-args "--requires=${project_name}_infra --env-file .env" up -d &&
|
||||||
echo -n "Waiting for hedgedoc to finish starting " &&
|
echo -n "Waiting for hedgedoc to finish starting " &&
|
||||||
( podman logs -f ${container_name} 2>&1 & ) | grep -q 'HTTP Server listening at ' &&
|
( podman container logs -f ${container_name} 2>&1 & ) | grep -q 'HTTP Server listening at ' &&
|
||||||
echo "OK" &&
|
echo "OK" &&
|
||||||
podman pod stop ${pod_name} &&
|
podman pod stop ${pod_name} &&
|
||||||
echo Pod built and stopped. &&
|
echo Pod built and stopped. &&
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# Créer un utilisateur
|
# Créer un utilisateur
|
||||||
Une fois le service démarré exécuter la coammande suivante en remplaçant user@domain.tld par ládresse de l'utilisateur et définir un mot de passe :
|
Une fois le service démarré exécuter la coammande suivante en remplaçant user@domain.tld par ládresse de l'utilisateur et définir un mot de passe :
|
||||||
```
|
```
|
||||||
podman exec --tty -i podman-hedgedoc_app bin/manage_users --add user@domain.tld
|
podman container exec --tty -i podman-hedgedoc_app bin/manage_users --add user@domain.tld
|
||||||
```
|
```
|
||||||
|
|
|
@ -14,22 +14,22 @@ if ! podman image exists ${hedgedoc_image}:${hedgedoc_version}; then
|
||||||
git clone --depth=1 https://github.com/hedgedoc/container ${buildfolder}/ && {
|
git clone --depth=1 https://github.com/hedgedoc/container ${buildfolder}/ && {
|
||||||
sed_in_place '^FROM --platform=$BUILDPLATFORM node' 'FROM --platform=$BUILDPLATFORM docker.io/library/node' ${buildfolder}/alpine/Dockerfile
|
sed_in_place '^FROM --platform=$BUILDPLATFORM node' 'FROM --platform=$BUILDPLATFORM docker.io/library/node' ${buildfolder}/alpine/Dockerfile
|
||||||
sed_in_place "^FROM node" "FROM docker.io/library/node" ${buildfolder}/alpine/Dockerfile
|
sed_in_place "^FROM node" "FROM docker.io/library/node" ${buildfolder}/alpine/Dockerfile
|
||||||
podman pull docker.io/moby/buildkit:latest
|
podman image pull docker.io/moby/buildkit:latest
|
||||||
podman run -d --name buildkitd --privileged docker.io/moby/buildkit:latest &&
|
podman container run -d --name buildkitd --privileged docker.io/moby/buildkit:latest &&
|
||||||
my_buildctl --addr=podman-container://buildkitd build \
|
my_buildctl --addr=podman-container://buildkitd build \
|
||||||
--frontend dockerfile.v0 \
|
--frontend dockerfile.v0 \
|
||||||
--opt build-arg:VERSION=${hedgedoc_version/%-alpine/} \
|
--opt build-arg:VERSION=${hedgedoc_version/%-alpine/} \
|
||||||
--local context=${buildfolder}/ \
|
--local context=${buildfolder}/ \
|
||||||
--local dockerfile=${buildfolder}/alpine/ \
|
--local dockerfile=${buildfolder}/alpine/ \
|
||||||
--output type=oci,name="${hedgedoc_image}:${hedgedoc_version}" | \
|
--output type=oci,name="${hedgedoc_image}:${hedgedoc_version}" | \
|
||||||
podman load &&
|
podman image load &&
|
||||||
podman rm --force buildkitd &&
|
podman container rm --force buildkitd &&
|
||||||
podman rmi docker.io/moby/buildkit:latest
|
podman image rm docker.io/moby/buildkit:latest
|
||||||
}
|
}
|
||||||
rm -rf ${buildfolder}
|
rm -rf ${buildfolder}
|
||||||
podman image prune -a -f --filter dangling=true
|
podman image prune -a -f --filter dangling=true
|
||||||
podman image prune -a -f --filter intermediate=true
|
podman image prune -a -f --filter intermediate=true
|
||||||
podman image rm -f $(podman images -a -q -- docker.io/library/node)
|
podman image rm -f $(podman image list -a -q -- docker.io/library/node)
|
||||||
else
|
else
|
||||||
echo "Image ${hedgedoc_image}:${hedgedoc_version} already built"
|
echo "Image ${hedgedoc_image}:${hedgedoc_version} already built"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -67,9 +67,9 @@ export listen_port
|
||||||
podman-compose --pod-args "--infra=true --infra-name=${project_name}_infra --share=" --podman-run-args "--requires=${project_name}_infra --env-file .env" up -d &&
|
podman-compose --pod-args "--infra=true --infra-name=${project_name}_infra --share=" --podman-run-args "--requires=${project_name}_infra --env-file .env" up -d &&
|
||||||
|
|
||||||
# Wait for web to be up
|
# Wait for web to be up
|
||||||
( podman logs --tail=3 -f ${project_name}_web_1 2>&1 & ) | grep -q '^\[services.d\] done.$' &&
|
( podman container logs --tail=3 -f ${project_name}_web_1 2>&1 & ) | grep -q '^\[services.d\] done.$' &&
|
||||||
podman cp assets/welcome-background.png ${project_name}_web_1:/usr/share/jitsi-meet/images/welcome-background.png &&
|
podman container cp assets/welcome-background.png ${project_name}_web_1:/usr/share/jitsi-meet/images/welcome-background.png &&
|
||||||
podman exec -t ${project_name}_web_1 chmod 444 /usr/share/jitsi-meet/images/welcome-background.png &&
|
podman container exec -t ${project_name}_web_1 chmod 444 /usr/share/jitsi-meet/images/welcome-background.png &&
|
||||||
podman pod stop ${pod_name} && echo Pod built and stopped.
|
podman pod stop ${pod_name} && echo Pod built and stopped.
|
||||||
|
|
||||||
# cleanup
|
# cleanup
|
||||||
|
|
|
@ -10,7 +10,7 @@ ensure_not_root
|
||||||
ensure_pod_exists ${pod_name}
|
ensure_pod_exists ${pod_name}
|
||||||
ensure_systemd_unit_exists ${service_name}
|
ensure_systemd_unit_exists ${service_name}
|
||||||
|
|
||||||
current_version=$(podman ps -a --format "{{.Image}}" | grep prosody | awk -F: '{print $NF}')
|
current_version=$(podman container list -a --format "{{.Image}}" | grep prosody | awk -F: '{print $NF}')
|
||||||
|
|
||||||
reinstall_please () {
|
reinstall_please () {
|
||||||
for image in ${upstream_images}; do
|
for image in ${upstream_images}; do
|
||||||
|
@ -32,7 +32,7 @@ cleanup_images () {
|
||||||
case $yn in
|
case $yn in
|
||||||
Yes)
|
Yes)
|
||||||
for image in ${upstream_images}; do
|
for image in ${upstream_images}; do
|
||||||
podman rmi ${image}:${current_version}
|
podman image rm ${image}:${current_version}
|
||||||
done
|
done
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -10,13 +10,13 @@ ensure_not_root
|
||||||
buildfolder=/tmp/docker-jitsi-meet-$$
|
buildfolder=/tmp/docker-jitsi-meet-$$
|
||||||
|
|
||||||
build_base() {
|
build_base() {
|
||||||
podman pull docker.io/library/debian:bullseye-slim
|
podman image pull docker.io/library/debian:bullseye-slim
|
||||||
if ! podman image exists localhost/jitsi/base:${version}; then
|
if ! podman image exists localhost/jitsi/base:${version}; then
|
||||||
podman build -t localhost/jitsi/base:${version} ${buildfolder}/base/ &&
|
podman image build -t localhost/jitsi/base:${version} ${buildfolder}/base/ &&
|
||||||
podman image tag localhost/jitsi/base:${version} localhost/jitsi/base:latest || exit -1
|
podman image tag localhost/jitsi/base:${version} localhost/jitsi/base:latest || exit -1
|
||||||
fi
|
fi
|
||||||
if ! podman image exists localhost/jitsi/base-java:${version}; then
|
if ! podman image exists localhost/jitsi/base-java:${version}; then
|
||||||
podman build -t localhost/jitsi/base-java:${version} ${buildfolder}/base-java &&
|
podman image 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
|
podman image tag localhost/jitsi/base-java:${version} localhost/jitsi/base-java:latest || exit -1
|
||||||
fi
|
fi
|
||||||
base_cleanup=true
|
base_cleanup=true
|
||||||
|
@ -26,28 +26,28 @@ mkdir ${buildfolder} &&
|
||||||
curl -sSfL -- "https://github.com/jitsi/docker-jitsi-meet/archive/refs/tags/${version}.tar.gz" | tar xz --strip-components 1 -C ${buildfolder}/ && {
|
curl -sSfL -- "https://github.com/jitsi/docker-jitsi-meet/archive/refs/tags/${version}.tar.gz" | tar xz --strip-components 1 -C ${buildfolder}/ && {
|
||||||
if ! podman image exists git.garbaye.fr/garbaye/jitsi-jvb:${version}; then
|
if ! podman image exists git.garbaye.fr/garbaye/jitsi-jvb:${version}; then
|
||||||
build_base
|
build_base
|
||||||
podman build -t git.garbaye.fr/garbaye/jitsi-jvb:${version} ${buildfolder}/jvb/ || exit -1
|
podman image build -t git.garbaye.fr/garbaye/jitsi-jvb:${version} ${buildfolder}/jvb/ || exit -1
|
||||||
fi
|
fi
|
||||||
if ! podman image exists git.garbaye.fr/garbaye/jitsi-jicofo:${version}; then
|
if ! podman image exists git.garbaye.fr/garbaye/jitsi-jicofo:${version}; then
|
||||||
build_base
|
build_base
|
||||||
podman build -t git.garbaye.fr/garbaye/jitsi-jicofo:${version} ${buildfolder}/jicofo/ || exit -1
|
podman image build -t git.garbaye.fr/garbaye/jitsi-jicofo:${version} ${buildfolder}/jicofo/ || exit -1
|
||||||
fi
|
fi
|
||||||
if ! podman image exists git.garbaye.fr/garbaye/jitsi-prosody:${version}; then
|
if ! podman image exists git.garbaye.fr/garbaye/jitsi-prosody:${version}; then
|
||||||
build_base
|
build_base
|
||||||
podman build -t git.garbaye.fr/garbaye/jitsi-prosody:${version} ${buildfolder}/prosody/ || exit -1
|
podman image build -t git.garbaye.fr/garbaye/jitsi-prosody:${version} ${buildfolder}/prosody/ || exit -1
|
||||||
fi
|
fi
|
||||||
if ! podman image exists git.garbaye.fr/garbaye/jitsi-web:${version}; then
|
if ! podman image exists git.garbaye.fr/garbaye/jitsi-web:${version}; then
|
||||||
build_base
|
build_base
|
||||||
# Fix for aardvark-dns < 1.2.0
|
# Fix for aardvark-dns < 1.2.0
|
||||||
# cf. https://git.garbaye.fr/Garbaye/services-garbaye/issues/7
|
# cf. https://git.garbaye.fr/Garbaye/services-garbaye/issues/7
|
||||||
sed_in_place "resolver {{ .Env.NGINX_RESOLVER }};" "resolver {{ .Env.NGINX_RESOLVER }} ipv6=off;" ${buildfolder}/web/rootfs/defaults/nginx.conf
|
sed_in_place "resolver {{ .Env.NGINX_RESOLVER }};" "resolver {{ .Env.NGINX_RESOLVER }} ipv6=off;" ${buildfolder}/web/rootfs/defaults/nginx.conf
|
||||||
podman build -t git.garbaye.fr/garbaye/jitsi-web:${version} ${buildfolder}/web/ || exit -1
|
podman image build -t git.garbaye.fr/garbaye/jitsi-web:${version} ${buildfolder}/web/ || exit -1
|
||||||
fi
|
fi
|
||||||
dangling_images=$(podman images -f "dangling=true" -q)
|
dangling_images=$(podman image list -f "dangling=true" -q)
|
||||||
[ ! -z "${dangling_images}" ] && podman rmi -f ${dangling_images}
|
[ ! -z "${dangling_images}" ] && podman image rm -f ${dangling_images}
|
||||||
if [ ! -z ${base_cleanup} ] ; then
|
if [ ! -z ${base_cleanup} ] ; then
|
||||||
podman rmi localhost/jitsi/base-java:${version} localhost/jitsi/base-java:latest
|
podman image rm localhost/jitsi/base-java:${version} localhost/jitsi/base-java:latest
|
||||||
podman rmi localhost/jitsi/base:${version} localhost/jitsi/base:latest
|
podman image rm localhost/jitsi/base:${version} localhost/jitsi/base:latest
|
||||||
fi
|
fi
|
||||||
} ; rm -rf ${buildfolder}
|
} ; rm -rf ${buildfolder}
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@ podman image pull ${synapse_image}:${synapse_version} &&
|
||||||
podman image exists ${synapse_image}:${synapse_version} &&
|
podman image exists ${synapse_image}:${synapse_version} &&
|
||||||
podman volume create ${confvolume} &&
|
podman volume create ${confvolume} &&
|
||||||
podman volume create ${dbvolume} &&
|
podman volume create ${dbvolume} &&
|
||||||
podman run -it --name ${container_name}-generate --mount type=volume,src=${confvolume},dst=/data -e SYNAPSE_SERVER_NAME=${GARBAYE_MATRIX_DOMAIN} -e SYNAPSE_REPORT_STATS=no ${synapse_image}:${synapse_version} generate &&
|
podman container run -it --name ${container_name}-generate --mount type=volume,src=${confvolume},dst=/data -e SYNAPSE_SERVER_NAME=${GARBAYE_MATRIX_DOMAIN} -e SYNAPSE_REPORT_STATS=no ${synapse_image}:${synapse_version} generate &&
|
||||||
podman rm ${container_name}-generate &&
|
podman container rm ${container_name}-generate &&
|
||||||
podman unshare sed -i -e "s|^#public_baseurl: https://example.com/$|public_baseurl: ${GARBAYE_MATRIX_URL}|g" `get_podman_volume_path ${confvolume}`/homeserver.yaml &&
|
podman unshare sed -i -e "s|^#public_baseurl: https://example.com/$|public_baseurl: ${GARBAYE_MATRIX_URL}|g" `get_podman_volume_path ${confvolume}`/homeserver.yaml &&
|
||||||
podman unshare sed -z -i -e "s|database:\n name: sqlite3\n args:\n database: /data/homeserver.db|database:\n name: psycopg2\n args:\n user: synapse\n password: ${GARBAYE_MATRIX_POSTGRES_PASSWORD}\n database: synapse\n host: synapse-db\n port: 5432\n cp_min: 5\n cp_max: 10|g" `get_podman_volume_path ${confvolume}`/homeserver.yaml &&
|
podman unshare sed -z -i -e "s|database:\n name: sqlite3\n args:\n database: /data/homeserver.db|database:\n name: psycopg2\n args:\n user: synapse\n password: ${GARBAYE_MATRIX_POSTGRES_PASSWORD}\n database: synapse\n host: synapse-db\n port: 5432\n cp_min: 5\n cp_max: 10|g" `get_podman_volume_path ${confvolume}`/homeserver.yaml &&
|
||||||
podman unshare sed -i -e "s|^#enable_registration: false$|enable_registration: false|g" `get_podman_volume_path ${confvolume}`/homeserver.yaml &&
|
podman unshare sed -i -e "s|^#enable_registration: false$|enable_registration: false|g" `get_podman_volume_path ${confvolume}`/homeserver.yaml &&
|
||||||
|
|
|
@ -23,12 +23,12 @@ fi
|
||||||
if ! podman image pull ${synapse_image}:${synapse_version}; then
|
if ! podman image pull ${synapse_image}:${synapse_version}; then
|
||||||
podman image pull ${synapse_image}:${synapse_version} || exit 1
|
podman image pull ${synapse_image}:${synapse_version} || exit 1
|
||||||
fi
|
fi
|
||||||
podman pull ${postgres_image}:${postgres_version} &&
|
podman image pull ${postgres_image}:${postgres_version} &&
|
||||||
if ! podman network exists ${project_name}_default; then
|
if ! podman network exists ${project_name}_default; then
|
||||||
podman network create ${project_name}_default
|
podman network create ${project_name}_default
|
||||||
fi
|
fi
|
||||||
podman pod create --name ${pod_name} --infra=true --infra-name=${project_name}_infra --share='' &&
|
podman pod create --name ${pod_name} --infra=true --infra-name=${project_name}_infra --share='' &&
|
||||||
podman run -d --name ${db_container_name} --pod ${pod_name} --requires=${project_name}_infra --net ${project_name}_default \
|
podman container run -d --name ${db_container_name} --pod ${pod_name} --requires=${project_name}_infra --net ${project_name}_default \
|
||||||
--mount type=volume,src=${dbvolume},dst=/var/lib/postgresql/data/ \
|
--mount type=volume,src=${dbvolume},dst=/var/lib/postgresql/data/ \
|
||||||
-e POSTGRES_PASSWORD=${GARBAYE_MATRIX_POSTGRES_PASSWORD} \
|
-e POSTGRES_PASSWORD=${GARBAYE_MATRIX_POSTGRES_PASSWORD} \
|
||||||
-e POSTGRES_USER=${container_name} \
|
-e POSTGRES_USER=${container_name} \
|
||||||
|
@ -36,12 +36,12 @@ podman run -d --name ${db_container_name} --pod ${pod_name} --requires=${project
|
||||||
-e POSTGRES_INITDB_ARGS="--encoding=UTF8 --locale=C" \
|
-e POSTGRES_INITDB_ARGS="--encoding=UTF8 --locale=C" \
|
||||||
${postgres_image}:${postgres_version} &&
|
${postgres_image}:${postgres_version} &&
|
||||||
echo -n "Waiting for PostgreSQL to be ready... " &&
|
echo -n "Waiting for PostgreSQL to be ready... " &&
|
||||||
( podman logs -f synapse-db 2>&1 & ) | grep -q 'database system is ready to accept connections' &&
|
( podman container logs -f ${db_container_name} 2>&1 & ) | grep -q 'database system is ready to accept connections' &&
|
||||||
echo "OK." &&
|
echo "OK." &&
|
||||||
podman run -d --name ${container_name} --pod ${pod_name} --requires=${project_name}_infra --net ${project_name}_default \
|
podman container run -d --name ${container_name} --pod ${pod_name} --requires=${project_name}_infra --net ${project_name}_default \
|
||||||
--mount type=volume,src=${confvolume},dst=/data --publish ${listen_if}:${listen_port}:8008 ${synapse_image}:${synapse_version} &&
|
--mount type=volume,src=${confvolume},dst=/data --publish ${listen_if}:${listen_port}:8008 ${synapse_image}:${synapse_version} &&
|
||||||
echo -n "Waiting for background tasks to end... " &&
|
echo -n "Waiting for background tasks to end... " &&
|
||||||
( podman logs -f synapse 2>&1 & ) | grep -q 'No more background updates to do' &&
|
( podman container logs -f ${container_name} 2>&1 & ) | grep -q 'No more background updates to do' &&
|
||||||
echo "OK." &&
|
echo "OK." &&
|
||||||
podman pod stop ${pod_name} &&
|
podman pod stop ${pod_name} &&
|
||||||
echo "Done. Pod built and stopped."
|
echo "Done. Pod built and stopped."
|
||||||
|
|
|
@ -11,7 +11,7 @@ ensure_pod_exists ${pod_name}
|
||||||
ensure_systemd_unit_exists ${service_name}
|
ensure_systemd_unit_exists ${service_name}
|
||||||
ensure_variables_are_defined "$envvars"
|
ensure_variables_are_defined "$envvars"
|
||||||
|
|
||||||
current_version=$(podman ps -a --format "{{.Image}}" | grep synapse | awk -F: '{print $NF}')
|
current_version=$(podman container list -a --format "{{.Image}}" | grep synapse | awk -F: '{print $NF}')
|
||||||
|
|
||||||
reinstall_please () {
|
reinstall_please () {
|
||||||
for image in ${upstream_images}; do
|
for image in ${upstream_images}; do
|
||||||
|
@ -32,7 +32,7 @@ cleanup_images () {
|
||||||
select yn in "Yes" "No"; do
|
select yn in "Yes" "No"; do
|
||||||
case $yn in
|
case $yn in
|
||||||
Yes)
|
Yes)
|
||||||
podman rmi ${synapse_image}:${current_version}
|
podman image rm ${synapse_image}:${current_version}
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
No)
|
No)
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
# Matrix (Synapse)
|
# Matrix (Synapse)
|
||||||
## Créer un utilisateur après le ./30_start.sh
|
## Créer un utilisateur après le ./30_start.sh
|
||||||
``` bash
|
``` bash
|
||||||
podman exec -ti synapse register_new_matrix_user -c /data/homeserver.yaml http://localhost:8008
|
podman container exec -ti synapse register_new_matrix_user -c /data/homeserver.yaml http://localhost:8008
|
||||||
```
|
```
|
||||||
## Accéder à l'administration de l'instance pour gérer les utilisateurs, salons, medias...
|
## Accéder à l'administration de l'instance pour gérer les utilisateurs, salons, medias...
|
||||||
``` bash
|
``` bash
|
||||||
podman run --rm --rmi -p 8080:80 docker://awesometechnologies/synapse-admin
|
podman container run --rm --rmi -p 8080:80 docker://awesometechnologies/synapse-admin
|
||||||
```
|
```
|
||||||
Se connecter ensuite à l'interface web avec un compte disposant des permissions "admistrateur serveur" sur http://localhost:8080
|
Se connecter ensuite à l'interface web avec un compte disposant des permissions "admistrateur serveur" sur http://localhost:8080
|
||||||
|
|
||||||
|
|
|
@ -12,16 +12,16 @@ buildfolder=/tmp/synapse-$$
|
||||||
if ! podman image exists ${synapse_image}:${synapse_version}; then
|
if ! podman image exists ${synapse_image}:${synapse_version}; then
|
||||||
mkdir ${buildfolder} &&
|
mkdir ${buildfolder} &&
|
||||||
curl -sSfL -- "https://github.com/matrix-org/synapse/archive/refs/tags/${synapse_version}.tar.gz" | \tar xz --strip-components 1 -C ${buildfolder}/ && {
|
curl -sSfL -- "https://github.com/matrix-org/synapse/archive/refs/tags/${synapse_version}.tar.gz" | \tar xz --strip-components 1 -C ${buildfolder}/ && {
|
||||||
podman pull docker.io/moby/buildkit:latest
|
podman image pull docker.io/moby/buildkit:latest
|
||||||
podman run -d --name buildkitd --privileged docker.io/moby/buildkit:latest &&
|
podman container run -d --name buildkitd --privileged docker.io/moby/buildkit:latest &&
|
||||||
my_buildctl --addr=podman-container://buildkitd build \
|
my_buildctl --addr=podman-container://buildkitd build \
|
||||||
--frontend dockerfile.v0 \
|
--frontend dockerfile.v0 \
|
||||||
--local context=${buildfolder}/ \
|
--local context=${buildfolder}/ \
|
||||||
--local dockerfile=${buildfolder}/docker/ \
|
--local dockerfile=${buildfolder}/docker/ \
|
||||||
--output type=oci,name="${synapse_image}:${synapse_version}" | \
|
--output type=oci,name="${synapse_image}:${synapse_version}" | \
|
||||||
podman load &&
|
podman image load &&
|
||||||
podman rm --force buildkitd &&
|
podman container rm --force buildkitd &&
|
||||||
podman rmi docker.io/moby/buildkit:latest
|
podman image rm docker.io/moby/buildkit:latest
|
||||||
}
|
}
|
||||||
rm -rf ${buildfolder}
|
rm -rf ${buildfolder}
|
||||||
else
|
else
|
||||||
|
|
|
@ -19,13 +19,13 @@ if ! podman image exists ${ntfy_image}:${ntfy_version}; then
|
||||||
podman image pull ${ntfy_image}:${ntfy_version} || exit 1
|
podman image pull ${ntfy_image}:${ntfy_version} || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
podman run --name ${container_name} \
|
podman container run --name ${container_name} \
|
||||||
-p ${listen_if}:${listen_port}:8080 \
|
-p ${listen_if}:${listen_port}:8080 \
|
||||||
-e TZ='Europe/Paris' \
|
-e TZ='Europe/Paris' \
|
||||||
-v ${ntfy_data_volume}:/var/lib/ntfy:Z \
|
-v ${ntfy_data_volume}:/var/lib/ntfy:Z \
|
||||||
-d ${ntfy_image}:${ntfy_version} serve \
|
-d ${ntfy_image}:${ntfy_version} serve \
|
||||||
--listen-http :8080 --base-url ${GARBAYE_NTFY_BASE_URL} &&
|
--listen-http :8080 --base-url ${GARBAYE_NTFY_BASE_URL} &&
|
||||||
( podman logs -f ${container_name} 2>&1 & ) | grep -q 'INFO Listening on' &&
|
( podman container logs -f ${container_name} 2>&1 & ) | grep -q 'INFO Listening on' &&
|
||||||
podman cp config/server.yml ${container_name}:/etc/ntfy/server.yml &&
|
podman container cp config/server.yml ${container_name}:/etc/ntfy/server.yml &&
|
||||||
podman stop ${container_name} &&
|
podman container stop ${container_name} &&
|
||||||
echo Container ${container_name} successfully built and stopped.
|
echo Container ${container_name} successfully built and stopped.
|
||||||
|
|
|
@ -31,7 +31,7 @@ cleanup_images () {
|
||||||
select yn in "Yes" "No"; do
|
select yn in "Yes" "No"; do
|
||||||
case $yn in
|
case $yn in
|
||||||
Yes)
|
Yes)
|
||||||
podman rmi ${current_image}:${current_version}
|
podman image rm ${current_image}:${current_version}
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
No)
|
No)
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
# Utilisateurs et Permissions (ACL)
|
# Utilisateurs et Permissions (ACL)
|
||||||
Documentation pour la gestion des [utilisateurs](https://docs.ntfy.sh/config/#users-and-roles) et [permissions](https://docs.ntfy.sh/config/#access-control-list-acl).
|
Documentation pour la gestion des [utilisateurs](https://docs.ntfy.sh/config/#users-and-roles) et [permissions](https://docs.ntfy.sh/config/#access-control-list-acl).
|
||||||
|
|
||||||
Pour lancer ntfy en interactif dans l'environnement `podman`, préfixer les commandes par `podman exec -it podman-ntfy` :
|
Pour lancer ntfy en interactif dans l'environnement `podman`, préfixer les commandes par `podman container exec -it podman-ntfy` :
|
||||||
|
|
||||||
```
|
```
|
||||||
$ podman exec -it podman-ntfy ntfy access
|
$ podman container exec -it podman-ntfy ntfy access
|
||||||
user * (anonymous)
|
user * (anonymous)
|
||||||
- no topic-specific permissions
|
- no topic-specific permissions
|
||||||
- read-write access to all (other) topics (server config)
|
- read-write access to all (other) topics (server config)
|
||||||
|
|
||||||
$ podman exec -it podman-ntfy ntfy user add didier
|
$ podman container exec -it podman-ntfy ntfy user add didier
|
||||||
user didier added with role user
|
user didier added with role user
|
||||||
|
|
||||||
$ podman exec -it podman-ntfy ntfy access didier prefix_* rw
|
$ podman container exec -it podman-ntfy ntfy access didier prefix_* rw
|
||||||
granted read-write access to topic prefix_*
|
granted read-write access to topic prefix_*
|
||||||
|
|
||||||
user didier (user)
|
user didier (user)
|
||||||
- read-write access to topic prefix_*
|
- read-write access to topic prefix_*
|
||||||
|
|
||||||
$ podman exec -it podman-ntfy ntfy access everyone prefix_* deny
|
$ podman container exec -it podman-ntfy ntfy access everyone prefix_* deny
|
||||||
revoked all access to topic prefix_*
|
revoked all access to topic prefix_*
|
||||||
|
|
||||||
user * (anonymous)
|
user * (anonymous)
|
||||||
|
|
|
@ -8,11 +8,11 @@ ensure_pwd_is_scriptdir
|
||||||
ensure_not_root
|
ensure_not_root
|
||||||
|
|
||||||
if ! podman image exists ${ntfy_image}:${ntfy_version}; then
|
if ! podman image exists ${ntfy_image}:${ntfy_version}; then
|
||||||
TMPDIR=${HOME} podman build -t "${ntfy_image}:${ntfy_version}" docker/ --build-arg NTFY_VERSION=${ntfy_version} || exit 1
|
TMPDIR=${HOME} podman image build -t "${ntfy_image}:${ntfy_version}" docker/ --build-arg NTFY_VERSION=${ntfy_version} || exit 1
|
||||||
podman image prune -a -f --filter dangling=true
|
podman image prune -a -f --filter dangling=true
|
||||||
podman image prune -a -f --filter intermediate=true
|
podman image prune -a -f --filter intermediate=true
|
||||||
podman image rm -f $(podman images -a -q -- docker.io/library/golang)
|
podman image rm -f $(podman image list -a -q -- docker.io/library/golang)
|
||||||
podman image rm -f $(podman images -a -q -- docker.io/library/alpine)
|
podman image rm -f $(podman image list -a -q -- docker.io/library/alpine)
|
||||||
else
|
else
|
||||||
echo "Image ${ntfy_image}:${ntfy_version} already built"
|
echo "Image ${ntfy_image}:${ntfy_version} already built"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -12,7 +12,7 @@ ensure_container_not_exists ${container_name}
|
||||||
if ! podman image exists ${upstream_images}:${version}; then
|
if ! podman image exists ${upstream_images}:${version}; then
|
||||||
podman image pull ${upstream_images}:${version} || exit 1
|
podman image pull ${upstream_images}:${version} || exit 1
|
||||||
fi
|
fi
|
||||||
podman run --name ${container_name} --user nobody -p ${listen_if}:${listen_port}:9000 -d ${upstream_images}:${version} --port 9000 --path /myapp &&
|
podman container run --name ${container_name} --user nobody -p ${listen_if}:${listen_port}:9000 -d ${upstream_images}:${version} --port 9000 --path /myapp &&
|
||||||
( podman logs -f ${container_name} 2>&1 & ) | grep -q 'Started PeerServer' &&
|
( podman container logs -f ${container_name} 2>&1 & ) | grep -q 'Started PeerServer' &&
|
||||||
podman stop ${container_name} &&
|
podman container stop ${container_name} &&
|
||||||
echo Container ${container_name} successfully built and stopped.
|
echo Container ${container_name} successfully built and stopped.
|
||||||
|
|
|
@ -20,7 +20,7 @@ fi
|
||||||
echo Rebuilding container ${container_name} with image ${upstream_imageversion}
|
echo Rebuilding container ${container_name} with image ${upstream_imageversion}
|
||||||
|
|
||||||
# pull first for minimal downtime
|
# pull first for minimal downtime
|
||||||
podman pull ${upstream_images}:${version} &&
|
podman image pull ${upstream_images}:${version} &&
|
||||||
|
|
||||||
${ABSDIR}/40_stop.sh &&
|
${ABSDIR}/40_stop.sh &&
|
||||||
${ABSDIR}/80_destroy.sh &&
|
${ABSDIR}/80_destroy.sh &&
|
||||||
|
@ -28,6 +28,6 @@ ${ABSDIR}/10_install.sh &&
|
||||||
${ABSDIR}/20_enable.sh &&
|
${ABSDIR}/20_enable.sh &&
|
||||||
${ABSDIR}/30_start.sh &&
|
${ABSDIR}/30_start.sh &&
|
||||||
|
|
||||||
podman rmi ${current_imageversion} &&
|
podman image rm ${current_imageversion} &&
|
||||||
|
|
||||||
${ABSDIR}/00_status.sh
|
${ABSDIR}/00_status.sh
|
||||||
|
|
|
@ -12,13 +12,13 @@ buildfolder=/tmp/peerjs-server-$$
|
||||||
if ! podman image exists ${upstream_images}:${version}; then
|
if ! podman image exists ${upstream_images}:${version}; then
|
||||||
mkdir ${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}/ &&
|
curl -sSfL -- "https://github.com/peers/peerjs-server/archive/refs/tags/v${version}.tar.gz" | \tar xz --strip-components 1 -C ${buildfolder}/ &&
|
||||||
podman build \
|
podman image build \
|
||||||
--label org.opencontainers.image.description='PeerServer helps establishing connections between PeerJS clients. Data is not proxied through the server.' \
|
--label org.opencontainers.image.description='PeerServer helps establishing connections between PeerJS clients. Data is not proxied through the server.' \
|
||||||
--label org.opencontainers.image.source='https://github.com/peers/peerjs-server' \
|
--label org.opencontainers.image.source='https://github.com/peers/peerjs-server' \
|
||||||
--label org.opencontainers.image.title='PeerServer' \
|
--label org.opencontainers.image.title='PeerServer' \
|
||||||
--label org.opencontainers.image.url='https://peerjs.com' \
|
--label org.opencontainers.image.url='https://peerjs.com' \
|
||||||
-t ${upstream_images}:${version} ${buildfolder}/ &&
|
-t ${upstream_images}:${version} ${buildfolder}/ &&
|
||||||
podman image rm -f $(podman images -a -q -- docker.io/library/node) &&
|
podman image rm -f $(podman image list -a -q -- docker.io/library/node) &&
|
||||||
rm -rf ${buildfolder}
|
rm -rf ${buildfolder}
|
||||||
else
|
else
|
||||||
echo "Image ${upstream_images}:${version} already built"
|
echo "Image ${upstream_images}:${version} already built"
|
||||||
|
|
|
@ -20,13 +20,13 @@ podman volume create ${tmp_volume} &&
|
||||||
podman volume create ${varlibnginxtmp_volume} &&
|
podman volume create ${varlibnginxtmp_volume} &&
|
||||||
podman unshare chown -R 65534:82 `get_podman_volume_path ${run_volume}` &&
|
podman unshare chown -R 65534:82 `get_podman_volume_path ${run_volume}` &&
|
||||||
podman unshare chown -R 65534:82 `get_podman_volume_path ${varlibnginxtmp_volume}` &&
|
podman unshare chown -R 65534:82 `get_podman_volume_path ${varlibnginxtmp_volume}` &&
|
||||||
podman run -d --read-only --restart=always --name ${container_name} \
|
podman container run -d --read-only --restart=always --name ${container_name} \
|
||||||
-p ${listen_if}:${listen_port}:8080 \
|
-p ${listen_if}:${listen_port}:8080 \
|
||||||
-v ${run_volume}:/run:Z \
|
-v ${run_volume}:/run:Z \
|
||||||
-v ${tmp_volume}:/tmp:Z \
|
-v ${tmp_volume}:/tmp:Z \
|
||||||
-v ${srvdata_volume}:/srv/data:Z \
|
-v ${srvdata_volume}:/srv/data:Z \
|
||||||
-v ${varlibnginxtmp_volume}:/var/lib/nginx/tmp:Z \
|
-v ${varlibnginxtmp_volume}:/var/lib/nginx/tmp:Z \
|
||||||
"${privatebin_image}":"${privatebin_version}" &&
|
"${privatebin_image}":"${privatebin_version}" &&
|
||||||
( podman logs -f ${container_name} 2>&1 & ) | grep -q 'NOTICE: ready to handle connections' &&
|
( podman container logs -f ${container_name} 2>&1 & ) | grep -q 'NOTICE: ready to handle connections' &&
|
||||||
podman stop ${container_name} &&
|
podman container stop ${container_name} &&
|
||||||
echo Container ${container_name} successfully built and stopped.
|
echo Container ${container_name} successfully built and stopped.
|
||||||
|
|
|
@ -10,7 +10,7 @@ ensure_not_root
|
||||||
if ! podman image exists ${privatebin_image}:${privatebin_version}; then
|
if ! podman image exists ${privatebin_image}:${privatebin_version}; then
|
||||||
git clone -b ${privatebin_version} --depth=1 https://github.com/PrivateBin/docker-nginx-fpm-alpine &&
|
git clone -b ${privatebin_version} --depth=1 https://github.com/PrivateBin/docker-nginx-fpm-alpine &&
|
||||||
sed -i "s#mv cfg lib tpl vendor /srv#mv cfg lib tpl vendor /srv \&\& sed -i \\'/Content-Security-Policy\\\|X-XSS-Protection\\\|X-Frame-Options\\\|X-Content-Type-Options/d\\' /srv/lib/Controller.php#" docker-nginx-fpm-alpine/Dockerfile &&
|
sed -i "s#mv cfg lib tpl vendor /srv#mv cfg lib tpl vendor /srv \&\& sed -i \\'/Content-Security-Policy\\\|X-XSS-Protection\\\|X-Frame-Options\\\|X-Content-Type-Options/d\\' /srv/lib/Controller.php#" docker-nginx-fpm-alpine/Dockerfile &&
|
||||||
podman build -t "${privatebin_image}":"${privatebin_version}" docker-nginx-fpm-alpine &&
|
podman image build -t "${privatebin_image}":"${privatebin_version}" docker-nginx-fpm-alpine &&
|
||||||
rm -rf docker-nginx-fpm-alpine
|
rm -rf docker-nginx-fpm-alpine
|
||||||
else
|
else
|
||||||
echo "Image ${privatebin_image}:${privatebin_version} already built"
|
echo "Image ${privatebin_image}:${privatebin_version} already built"
|
||||||
|
|
|
@ -38,8 +38,8 @@ export listen_port
|
||||||
if ! podman image exists ${seafile_image}:${seafile_release}; then
|
if ! podman image exists ${seafile_image}:${seafile_release}; then
|
||||||
podman image pull ${seafile_image}:${seafile_release} || exit 1
|
podman image pull ${seafile_image}:${seafile_release} || exit 1
|
||||||
fi
|
fi
|
||||||
podman pull docker.io/library/memcached:${memcached_release} &&
|
podman image pull docker.io/library/memcached:${memcached_release} &&
|
||||||
podman pull docker.io/library/mariadb:${mariadb_release} &&
|
podman image pull docker.io/library/mariadb:${mariadb_release} &&
|
||||||
podman-compose --pod-args="--infra=true --infra-name=${project_name}_infra --share=" --podman-run-args "--requires=${project_name}_infra --env-file .env" up -d &&
|
podman-compose --pod-args="--infra=true --infra-name=${project_name}_infra --share=" --podman-run-args "--requires=${project_name}_infra --env-file .env" up -d &&
|
||||||
echo -n "Waiting for seahub_settings.py " &&
|
echo -n "Waiting for seahub_settings.py " &&
|
||||||
while [ ! -e `get_podman_volume_path ${datavolume}`/seafile/conf/seahub_settings.py ]; do
|
while [ ! -e `get_podman_volume_path ${datavolume}`/seafile/conf/seahub_settings.py ]; do
|
||||||
|
@ -48,7 +48,7 @@ while [ ! -e `get_podman_volume_path ${datavolume}`/seafile/conf/seahub_settings
|
||||||
done && echo "OK" &&
|
done && echo "OK" &&
|
||||||
sed -i -e "s|^FILE_SERVER_ROOT = \"http://${GARBAYE_SEAFILE_SERVER_HOSTNAME}/seafhttp\"|FILE_SERVER_ROOT = \"https://${GARBAYE_SEAFILE_SERVER_HOSTNAME}/seafhttp\"\nEMAIL_USE_TLS = False\nEMAIL_HOST = '${GARBAYE_SEAFILE_SMTP_SERVER}'\nEMAIL_HOST_USER = ''\nEMAIL_HOST_PASSWORD = ''\nEMAIL_PORT = 25\nDEFAULT_FROM_EMAIL = 'noreply@seafile.garbaye.fr'\nSERVER_EMAIL = 'noreply@seafile.garbaye.fr'|g" `get_podman_volume_path ${datavolume}`/seafile/conf/seahub_settings.py &&
|
sed -i -e "s|^FILE_SERVER_ROOT = \"http://${GARBAYE_SEAFILE_SERVER_HOSTNAME}/seafhttp\"|FILE_SERVER_ROOT = \"https://${GARBAYE_SEAFILE_SERVER_HOSTNAME}/seafhttp\"\nEMAIL_USE_TLS = False\nEMAIL_HOST = '${GARBAYE_SEAFILE_SMTP_SERVER}'\nEMAIL_HOST_USER = ''\nEMAIL_HOST_PASSWORD = ''\nEMAIL_PORT = 25\nDEFAULT_FROM_EMAIL = 'noreply@seafile.garbaye.fr'\nSERVER_EMAIL = 'noreply@seafile.garbaye.fr'|g" `get_podman_volume_path ${datavolume}`/seafile/conf/seahub_settings.py &&
|
||||||
echo -n "Waiting for seahub to finish starting " &&
|
echo -n "Waiting for seahub to finish starting " &&
|
||||||
( podman logs -f seafile 2>&1 & ) | grep -q 'Seahub is started' &&
|
( podman container logs -f seafile 2>&1 & ) | grep -q 'Seahub is started' &&
|
||||||
echo "OK" &&
|
echo "OK" &&
|
||||||
podman pod stop ${pod_name} &&
|
podman pod stop ${pod_name} &&
|
||||||
echo Pod built and stopped. &&
|
echo Pod built and stopped. &&
|
||||||
|
|
|
@ -18,10 +18,10 @@ if ! podman image exists ${seafile_image}:${seafile_release}; then
|
||||||
sed_in_place " -i https://pypi.tuna.tsinghua.edu.cn/simple/" " " ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile &&
|
sed_in_place " -i https://pypi.tuna.tsinghua.edu.cn/simple/" " " ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile &&
|
||||||
sed_in_place 'wget https://seafile-downloads.oss-cn-shanghai.aliyuncs.com' 'wget -q https://download.seadrive.org' ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile &&
|
sed_in_place 'wget https://seafile-downloads.oss-cn-shanghai.aliyuncs.com' 'wget -q https://download.seadrive.org' ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile &&
|
||||||
sed_in_place 'tar -zxvf' 'tar -zxf' ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile &&
|
sed_in_place 'tar -zxvf' 'tar -zxf' ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile &&
|
||||||
podman build -t ${seafile_image}:${seafile_release} \
|
podman image build -t ${seafile_image}:${seafile_release} \
|
||||||
-f ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile \
|
-f ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile \
|
||||||
${buildfolder} &&
|
${buildfolder} &&
|
||||||
podman rmi -f $(podman images -a -q -- phusion/baseimage)
|
podman image rm -f $(podman image list -a -q -- phusion/baseimage)
|
||||||
rm -rf ${buildfolder}
|
rm -rf ${buildfolder}
|
||||||
else
|
else
|
||||||
echo "Image ${seafile_image}:${seafile_release} already built"
|
echo "Image ${seafile_image}:${seafile_release} already built"
|
||||||
|
|
|
@ -55,7 +55,7 @@ if ! podman image exists ${database_image}:${database_version}; then
|
||||||
fi
|
fi
|
||||||
podman-compose --pod-args="--infra=true --infra-name=${project_name}_infra --share=" --podman-run-args "--requires=${project_name}_infra --env-file .env" up -d &&
|
podman-compose --pod-args="--infra=true --infra-name=${project_name}_infra --share=" --podman-run-args "--requires=${project_name}_infra --env-file .env" up -d &&
|
||||||
echo -n "Waiting for vaultwarden to finish starting " &&
|
echo -n "Waiting for vaultwarden to finish starting " &&
|
||||||
( podman logs -f ${container_name} 2>&1 & ) | grep -q 'Rocket has launched from ' &&
|
( podman container logs -f ${container_name} 2>&1 & ) | grep -q 'Rocket has launched from ' &&
|
||||||
echo "OK" &&
|
echo "OK" &&
|
||||||
podman pod stop ${pod_name} &&
|
podman pod stop ${pod_name} &&
|
||||||
echo Pod built and stopped. &&
|
echo Pod built and stopped. &&
|
||||||
|
|
|
@ -20,9 +20,9 @@ if ! podman image exists ${vaultwarden_image}:${vaultwarden_version}; then
|
||||||
rm -rf ${buildfolder}
|
rm -rf ${buildfolder}
|
||||||
podman image prune -a -f --filter dangling=true
|
podman image prune -a -f --filter dangling=true
|
||||||
podman image prune -a -f --filter intermediate=true
|
podman image prune -a -f --filter intermediate=true
|
||||||
podman image rm -f $(podman images -a -q -- vaultwarden/web-vault)
|
podman image rm -f $(podman image list -a -q -- vaultwarden/web-vault)
|
||||||
podman image rm -f $(podman images -a -q -- docker.io/blackdex/rust-musl)
|
podman image rm -f $(podman image list -a -q -- docker.io/blackdex/rust-musl)
|
||||||
podman image rm -f $(podman images -a -q -- dockerio/library/alpine)
|
podman image rm -f $(podman image list -a -q -- dockerio/library/alpine)
|
||||||
else
|
else
|
||||||
echo "Image ${vaultwarden_image}:${vaultwarden_version} already built"
|
echo "Image ${vaultwarden_image}:${vaultwarden_version} already built"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue