summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2023-01-05 13:30:07 +0100
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2023-01-05 13:32:27 +0100
commit83f9bc5e1314c32422d4030763853e76fd56290c (patch)
treece5d3cbb24f34ce9817b42ed8f8f0c714bd9f441
parent6f6c89eac6a6a5d036be4f2f826d8d96c1052b88 (diff)
CI: Support Podman as an alternative to Docker
Podman-compose (can be aliased to docker-compose now) does not have the exact same options. We move the compose file to the root to support podman. This is also better because users can just execute docker-compose in the root.
-rw-r--r--ci/docker/eduvpnserver.docker (renamed from ci/docker/eduvpn-server.docker)0
-rw-r--r--ci/docker/gotest.docker (renamed from ci/docker/go-test.docker)0
-rwxr-xr-xci/startcompose.sh13
-rw-r--r--docker-compose.yml (renamed from ci/docker/docker-compose.yml)22
4 files changed, 13 insertions, 22 deletions
diff --git a/ci/docker/eduvpn-server.docker b/ci/docker/eduvpnserver.docker
index fd9891d..fd9891d 100644
--- a/ci/docker/eduvpn-server.docker
+++ b/ci/docker/eduvpnserver.docker
diff --git a/ci/docker/go-test.docker b/ci/docker/gotest.docker
index ec98d0c..ec98d0c 100644
--- a/ci/docker/go-test.docker
+++ b/ci/docker/gotest.docker
diff --git a/ci/startcompose.sh b/ci/startcompose.sh
index 5f0338f..e65fa86 100755
--- a/ci/startcompose.sh
+++ b/ci/startcompose.sh
@@ -13,9 +13,14 @@ fi
# Get absolute path to current directory this script is in
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
+pushd "$SCRIPT_DIR"/..
+
# Create self-signed certificate
-mkdir -p "$SCRIPT_DIR"/docker/selfsigned
-"$SCRIPT_DIR"/docker/createcert.sh
+mkdir -p ci/docker/selfsigned
+./ci/docker/createcert.sh
+
+# Up the containers and abort on exit. Also rebuild the necessary steps if there are changes
+# You can symlink docker-compose to podman-compose to use Podman
+docker-compose up --build --force-recreate --abort-on-container-exit
-# Get the parent directory to get the root directory
-docker-compose --file ci/docker/docker-compose.yml --project-directory "$SCRIPT_DIR"/.. up --build --force-recreate --abort-on-container-exit
+popd
diff --git a/ci/docker/docker-compose.yml b/docker-compose.yml
index 066c41d..6483a7a 100644
--- a/ci/docker/docker-compose.yml
+++ b/docker-compose.yml
@@ -9,26 +9,15 @@ x-common-env: &common-env
OAUTH_EXPIRED_TTL: ${OAUTH_EXPIRED_TTL}
SERVER_URI: "https://eduvpnserver"
-# Define a network so that the containers can talk with eachother using their service name
-networks:
- eduvpn_network:
- ipam:
- driver: default
- config:
- - subnet: 172.20.0.0/24
-
# Defines the services
services:
# The eduvpn server with portal
eduvpnserver:
build:
- context: "."
- dockerfile: 'ci/docker/eduvpn-server.docker'
+ context: .
+ dockerfile: ci/docker/eduvpnserver.docker
sysctls: # needed for wireguard permissions, otherwise we get a permisison failed
- net.ipv6.conf.all.disable_ipv6=0
- networks:
- eduvpn_network:
- ipv4_address: 172.20.0.6
cap_add: # needed for wireguard
- NET_ADMIN
environment: *common-env
@@ -40,12 +29,9 @@ services:
# The container for testing the go code
gotest:
build:
- context: "."
- dockerfile: 'ci/docker/go-test.docker'
+ context: .
+ dockerfile: ci/docker/gotest.docker
environment: *common-env
- networks:
- eduvpn_network:
- ipv4_address: 172.20.0.5
# Wait for eduvpn server to come online
depends_on:
eduvpnserver: