refactor: docker to podman (#38)
This commit is contained in:
commit
ded4fe92b0
23 changed files with 47 additions and 48 deletions
|
@ -17,6 +17,9 @@ vars:
|
||||||
sh: git describe --tags --exact-match $(git rev-parse HEAD) 2> /dev/null || echo "dev-$(git rev-parse HEAD)"
|
sh: git describe --tags --exact-match $(git rev-parse HEAD) 2> /dev/null || echo "dev-$(git rev-parse HEAD)"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
ensure-pod:
|
||||||
|
desc: "Creates the pod if it doesn't already exist."
|
||||||
|
cmd: . ./pod.sh
|
||||||
build:
|
build:
|
||||||
desc: "Builds images for one or more services. Include service names as a space-separated list."
|
desc: "Builds images for one or more services. Include service names as a space-separated list."
|
||||||
cmds:
|
cmds:
|
||||||
|
@ -28,6 +31,7 @@ tasks:
|
||||||
prefix: "build: {{ .CLI_ARGS }}"
|
prefix: "build: {{ .CLI_ARGS }}"
|
||||||
dir: services
|
dir: services
|
||||||
start:
|
start:
|
||||||
|
deps: [ensure-pod]
|
||||||
desc: "Starts one or more services. Include service names as a space-separated list."
|
desc: "Starts one or more services. Include service names as a space-separated list."
|
||||||
cmds:
|
cmds:
|
||||||
- for: { var: CLI_ARGS }
|
- for: { var: CLI_ARGS }
|
||||||
|
|
1
apt.txt
Normal file
1
apt.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
podman
|
4
pod.sh
Normal file
4
pod.sh
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
podman pod exists services || true
|
||||||
|
test $? -eq 0 || podman pod create -p 8080:8080 -p 6881:6881/udp -p 6881:6881 -p 8112:8112 services
|
7
provision.sh
Normal file
7
provision.sh
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#/bin/bash
|
||||||
|
|
||||||
|
# Ensure that dependencies are up to date.
|
||||||
|
sudo apt update && sudo apt upgrade -y --autoremove
|
||||||
|
|
||||||
|
# Ensure that critical dependencies are installed.
|
||||||
|
sudo apt install $(cat apt.txt) -y
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
source constants.sh
|
source constants.sh
|
||||||
|
|
||||||
docker build -t $APP_IMAGE_NAME:$IMAGE_VERSION -f Dockerfile-bastion-app .
|
podman build -t $APP_IMAGE_NAME:$IMAGE_VERSION -f Dockerfile-bastion-app .
|
||||||
|
|
|
@ -3,4 +3,3 @@
|
||||||
export APP_NAME="bastion"
|
export APP_NAME="bastion"
|
||||||
export APP_CONTAINER_NAME=$APP_NAME-app
|
export APP_CONTAINER_NAME=$APP_NAME-app
|
||||||
export APP_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$APP_CONTAINER_NAME
|
export APP_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$APP_CONTAINER_NAME
|
||||||
export NETWORK_NAME=$APP_NAME-local
|
|
||||||
|
|
|
@ -2,11 +2,9 @@
|
||||||
|
|
||||||
source constants.sh
|
source constants.sh
|
||||||
|
|
||||||
docker network create $NETWORK_NAME || echo "Network $NETWORK_NAME already exists"
|
podman run \
|
||||||
|
|
||||||
docker run \
|
|
||||||
--detach \
|
--detach \
|
||||||
--network $NETWORK_NAME \
|
--pod services \
|
||||||
--name $APP_CONTAINER_NAME \
|
--name $APP_CONTAINER_NAME \
|
||||||
--env-file $ENV_FILE_DIR/bastion.env \
|
--env-file $ENV_FILE_DIR/bastion.env \
|
||||||
$APP_IMAGE_NAME:$IMAGE_VERSION
|
$APP_IMAGE_NAME:$IMAGE_VERSION
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
source constants.sh
|
source constants.sh
|
||||||
|
|
||||||
docker rm -f $APP_CONTAINER_NAME
|
podman rm -f $APP_CONTAINER_NAME
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
source constants.sh
|
source constants.sh
|
||||||
|
|
||||||
docker build -t $DB_IMAGE_NAME:$IMAGE_VERSION -f Dockerfile-bitwarden-db .
|
podman build -t $DB_IMAGE_NAME:$IMAGE_VERSION -f Dockerfile-bitwarden-db .
|
||||||
docker build -t $APP_IMAGE_NAME:$IMAGE_VERSION -f Dockerfile-bitwarden-app .
|
podman build -t $APP_IMAGE_NAME:$IMAGE_VERSION -f Dockerfile-bitwarden-app .
|
||||||
|
|
|
@ -5,4 +5,3 @@ export APP_CONTAINER_NAME=$APP_NAME-app
|
||||||
export APP_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$APP_CONTAINER_NAME
|
export APP_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$APP_CONTAINER_NAME
|
||||||
export DB_CONTAINER_NAME=$APP_NAME-db
|
export DB_CONTAINER_NAME=$APP_NAME-db
|
||||||
export DB_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$DB_CONTAINER_NAME
|
export DB_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$DB_CONTAINER_NAME
|
||||||
export NETWORK_NAME=$APP_NAME-local
|
|
||||||
|
|
|
@ -2,22 +2,19 @@
|
||||||
|
|
||||||
source constants.sh
|
source constants.sh
|
||||||
|
|
||||||
docker network create $NETWORK_NAME || echo "Network $NETWORK_NAME already exists"
|
podman run \
|
||||||
|
|
||||||
docker run \
|
|
||||||
--detach \
|
--detach \
|
||||||
--network $NETWORK_NAME \
|
--pod services \
|
||||||
--name $DB_CONTAINER_NAME \
|
--name $DB_CONTAINER_NAME \
|
||||||
--env-file $ENV_FILE_DIR/bitwarden-db.env \
|
--env-file $ENV_FILE_DIR/bitwarden-db.env \
|
||||||
--mount type=bind,source=$APP_DATA_DIR/bitwarden/db,target=/var/lib/mysql \
|
--mount type=bind,source=$APP_DATA_DIR/bitwarden/db,target=/var/lib/mysql \
|
||||||
$DB_IMAGE_NAME:$IMAGE_VERSION
|
$DB_IMAGE_NAME:$IMAGE_VERSION
|
||||||
|
|
||||||
docker run \
|
podman run \
|
||||||
--detach \
|
--detach \
|
||||||
--network $NETWORK_NAME \
|
--pod services \
|
||||||
--name $APP_CONTAINER_NAME \
|
--name $APP_CONTAINER_NAME \
|
||||||
--env-file $ENV_FILE_DIR/bitwarden-web.env \
|
--env-file $ENV_FILE_DIR/bitwarden-web.env \
|
||||||
--publish 8080:8080 \
|
|
||||||
--mount type=bind,source=$APP_DATA_DIR/bitwarden/config,target=/etc/bitwarden \
|
--mount type=bind,source=$APP_DATA_DIR/bitwarden/config,target=/etc/bitwarden \
|
||||||
--mount type=bind,source=$APP_DATA_DIR/bitwarden/logs,target=/var/log/bitwarden \
|
--mount type=bind,source=$APP_DATA_DIR/bitwarden/logs,target=/var/log/bitwarden \
|
||||||
$APP_IMAGE_NAME:$IMAGE_VERSION
|
$APP_IMAGE_NAME:$IMAGE_VERSION
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
source constants.sh
|
source constants.sh
|
||||||
|
|
||||||
docker rm -f $APP_CONTAINER_NAME
|
podman rm -f $APP_CONTAINER_NAME
|
||||||
docker rm -f $DB_CONTAINER_NAME
|
podman rm -f $DB_CONTAINER_NAME
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
source constants.sh
|
source constants.sh
|
||||||
|
|
||||||
docker build -t $DB_IMAGE_NAME:$IMAGE_VERSION -f Dockerfile-bookstack-db .
|
podman build -t $DB_IMAGE_NAME:$IMAGE_VERSION -f Dockerfile-bookstack-db .
|
||||||
docker build -t $APP_IMAGE_NAME:$IMAGE_VERSION -f Dockerfile-bookstack-app .
|
podman build -t $APP_IMAGE_NAME:$IMAGE_VERSION -f Dockerfile-bookstack-app .
|
||||||
|
|
|
@ -5,4 +5,3 @@ export APP_CONTAINER_NAME=$APP_NAME-app
|
||||||
export APP_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$APP_CONTAINER_NAME
|
export APP_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$APP_CONTAINER_NAME
|
||||||
export DB_CONTAINER_NAME=$APP_NAME-db
|
export DB_CONTAINER_NAME=$APP_NAME-db
|
||||||
export DB_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$DB_CONTAINER_NAME
|
export DB_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$DB_CONTAINER_NAME
|
||||||
export NETWORK_NAME=$APP_NAME-local
|
|
||||||
|
|
|
@ -2,21 +2,19 @@
|
||||||
|
|
||||||
source constants.sh
|
source constants.sh
|
||||||
|
|
||||||
docker network create $NETWORK_NAME || echo "Network $NETWORK_NAME already exists"
|
podman run \
|
||||||
|
|
||||||
docker run \
|
|
||||||
--detach \
|
--detach \
|
||||||
--network $NETWORK_NAME \
|
--pod services \
|
||||||
--name $DB_CONTAINER_NAME \
|
--name $DB_CONTAINER_NAME \
|
||||||
--env-file $ENV_FILE_DIR/bookstack-db.env \
|
--env-file $ENV_FILE_DIR/bookstack-db.env \
|
||||||
--mount type=bind,source=$APP_DATA_DIR/bookstack-db,target=/var/lib/mysql \
|
--mount type=bind,source=$APP_DATA_DIR/bookstack-db,target=/var/lib/mysql \
|
||||||
$DB_IMAGE_NAME:$IMAGE_VERSION
|
mariadb:10.6 \
|
||||||
|
--port 3307
|
||||||
|
|
||||||
docker run \
|
podman run \
|
||||||
--detach \
|
--detach \
|
||||||
--network $NETWORK_NAME \
|
--pod services \
|
||||||
--name $APP_CONTAINER_NAME \
|
--name $APP_CONTAINER_NAME \
|
||||||
--env-file $ENV_FILE_DIR/bookstack-app.env \
|
--env-file $ENV_FILE_DIR/bookstack-app.env \
|
||||||
--publish 6875:80 \
|
|
||||||
--mount type=bind,source=$APP_DATA_DIR/bookstack-app,target=/config \
|
--mount type=bind,source=$APP_DATA_DIR/bookstack-app,target=/config \
|
||||||
$APP_IMAGE_NAME:$IMAGE_VERSION
|
$APP_IMAGE_NAME:$IMAGE_VERSION
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
source constants.sh
|
source constants.sh
|
||||||
|
|
||||||
docker rm -f $APP_CONTAINER_NAME
|
podman rm -f $APP_CONTAINER_NAME
|
||||||
docker rm -f $DB_CONTAINER_NAME
|
podman rm -f $DB_CONTAINER_NAME
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
source constants.sh
|
source constants.sh
|
||||||
|
|
||||||
docker build -t $APP_IMAGE_NAME:$IMAGE_VERSION -f Dockerfile-deluge-app .
|
podman build -t $APP_IMAGE_NAME:$IMAGE_VERSION -f Dockerfile-deluge-app .
|
||||||
|
|
|
@ -3,4 +3,3 @@
|
||||||
export APP_NAME="deluge"
|
export APP_NAME="deluge"
|
||||||
export APP_CONTAINER_NAME=$APP_NAME-app
|
export APP_CONTAINER_NAME=$APP_NAME-app
|
||||||
export APP_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$APP_CONTAINER_NAME
|
export APP_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$APP_CONTAINER_NAME
|
||||||
export NETWORK_NAME=$APP_NAME-local
|
|
||||||
|
|
|
@ -2,16 +2,13 @@
|
||||||
|
|
||||||
source constants.sh
|
source constants.sh
|
||||||
|
|
||||||
docker network create $NETWORK_NAME || echo "Network $NETWORK_NAME already exists"
|
podman run \
|
||||||
|
|
||||||
docker run \
|
|
||||||
--detach \
|
--detach \
|
||||||
--network $NETWORK_NAME \
|
--pod services \
|
||||||
|
-e PGUID=1000 \
|
||||||
|
-e PGID=1000 \
|
||||||
--name $APP_CONTAINER_NAME \
|
--name $APP_CONTAINER_NAME \
|
||||||
--env-file $ENV_FILE_DIR/deluge.env \
|
--env-file $ENV_FILE_DIR/deluge.env \
|
||||||
--publish 8112:8112 \
|
|
||||||
--publish 6881:6881/udp \
|
|
||||||
--publish 6881:6881/tcp \
|
|
||||||
--mount type=bind,source=$APP_DATA_DIR/deluge/config,target=/config \
|
--mount type=bind,source=$APP_DATA_DIR/deluge/config,target=/config \
|
||||||
--mount type=bind,source=$APP_DATA_DIR/deluge/downloads,target=/downloads \
|
--mount type=bind,source=$APP_DATA_DIR/deluge/downloads,target=/downloads \
|
||||||
--mount type=bind,source=$STORAGE_DIR,target=/complete \
|
--mount type=bind,source=$STORAGE_DIR,target=/complete \
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
source constants.sh
|
source constants.sh
|
||||||
|
|
||||||
docker rm -f $APP_CONTAINER_NAME
|
podman rm -f $APP_CONTAINER_NAME
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
source constants.sh
|
source constants.sh
|
||||||
|
|
||||||
docker build -t $APP_IMAGE_NAME:$IMAGE_VERSION -f Dockerfile-plex-app .
|
podman build -t $APP_IMAGE_NAME:$IMAGE_VERSION -f Dockerfile-plex-app .
|
||||||
|
|
|
@ -2,11 +2,8 @@
|
||||||
|
|
||||||
source constants.sh
|
source constants.sh
|
||||||
|
|
||||||
docker network create $NETWORK_NAME || echo "Network $NETWORK_NAME already exists"
|
podman run \
|
||||||
|
|
||||||
docker run \
|
|
||||||
--detach \
|
--detach \
|
||||||
--network $NETWORK_NAME \
|
|
||||||
--name $APP_CONTAINER_NAME \
|
--name $APP_CONTAINER_NAME \
|
||||||
--env-file $ENV_FILE_DIR/plex.env \
|
--env-file $ENV_FILE_DIR/plex.env \
|
||||||
--publish 32401:32400 \
|
--publish 32401:32400 \
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
source constants.sh
|
source constants.sh
|
||||||
|
|
||||||
docker rm -f $APP_CONTAINER_NAME
|
podman rm -f $APP_CONTAINER_NAME
|
||||||
|
|
Reference in a new issue