diff --git a/applications/wg-easy/Taskfile.yaml b/applications/wg-easy/Taskfile.yaml index 5707be47..e7e6d1e2 100644 --- a/applications/wg-easy/Taskfile.yaml +++ b/applications/wg-easy/Taskfile.yaml @@ -28,9 +28,10 @@ vars: GCP_ZONE: '{{.GCP_ZONE | default "us-central1-a"}}' VM_NAME: '{{.VM_NAME | default (printf "%s-dev" (or (env "GUSER") "user"))}}' - # Docker workflow configuration + # Container workflow configuration IMAGE_NAME: ttl.sh/wg-easy-dev CONTAINER_NAME: wg-easy-dev + CONTAINER_RUNTIME: '{{.CONTAINER_RUNTIME | default "podman"}}' tasks: default: diff --git a/applications/wg-easy/container/Containerfile b/applications/wg-easy/container/Containerfile index 82274492..0044c779 100644 --- a/applications/wg-easy/container/Containerfile +++ b/applications/wg-easy/container/Containerfile @@ -1,5 +1,5 @@ -# Base image for all shared Dockerfiles for taskfiles -# Use this image as base image for app specific docker files +# Base image for all shared Containerfiles for taskfiles +# Use this image as base image for app specific container files FROM --platform=$BUILDPLATFORM ubuntu:24.04 ARG TARGETOS diff --git a/applications/wg-easy/docs/development-workflow.md b/applications/wg-easy/docs/development-workflow.md index e6906c48..13f5ce3a 100644 --- a/applications/wg-easy/docs/development-workflow.md +++ b/applications/wg-easy/docs/development-workflow.md @@ -18,9 +18,9 @@ The core philosophy of this workflow is to start simple and add complexity incre Before starting the development workflow, ensure you have the following tools installed: - **Task:** The task runner used in this project. ([Installation Guide](https://taskfile.dev/installation/)) -- **Docker:** Container runtime for local development. ([Installation Guide](https://docs.docker.com/get-docker/)) +- **Container runtime tool** Either [Podman](https://podman.io/docs/installation) (default) or [Docker](https://docs.docker.com/get-docker/) for local development -All other tools will be automatically provided through task commands and Docker containers. +All other tools will be automatically provided through task commands and containers. ## Workflow Stages diff --git a/applications/wg-easy/taskfiles/container.yml b/applications/wg-easy/taskfiles/container.yml index b6c56741..badcd03a 100644 --- a/applications/wg-easy/taskfiles/container.yml +++ b/applications/wg-easy/taskfiles/container.yml @@ -3,7 +3,7 @@ version: "3" # Development environment tasks tasks: build-image: - desc: Build development Docker image + desc: Build development container image vars: IMAGE_NAME: '{{.IMAGE_NAME}}' IMAGE_TAG: '{{.IMAGE_TAG | default "latest"}}' @@ -13,7 +13,7 @@ tasks: vars: [IMAGE_NAME, IMAGE_TAG, CONTAINERFILE] cmds: - - docker build -t {{.IMAGE_NAME}} -f {{.CONTAINERFILE}} . + - '{{.CONTAINER_RUNTIME}} build -t {{.IMAGE_NAME}} -f {{.CONTAINERFILE}} .' start: desc: Start development container in background @@ -36,11 +36,11 @@ tasks: vars: [IMAGE_NAME, CONTAINER_NAME, REPLICATED_API_TOKEN] status: - - docker ps | grep -q "{{.CONTAINER_NAME}}" + - '{{.CONTAINER_RUNTIME}} ps | grep -q "{{.CONTAINER_NAME}}"' cmds: - | # Start container with host networking for kubectl port-forward compatibility - CONTAINER_ID=$(docker run --rm --name {{.CONTAINER_NAME}} -d \ + CONTAINER_ID=$({{.CONTAINER_RUNTIME}} run --rm --name {{.CONTAINER_NAME}} -d \ -v $(pwd):/workspace \ -e HOME=/home/devuser \ -e USER=devuser \ @@ -64,7 +64,7 @@ tasks: - start-implementation cmds: - echo "Connecting to {{.CONTAINER_NAME}}..." - - docker exec -it {{.CONTAINER_NAME}} /bin/bash + - '{{.CONTAINER_RUNTIME}} exec -it {{.CONTAINER_NAME}} /bin/bash' stop: desc: Stop development container @@ -73,9 +73,9 @@ tasks: vars: [CONTAINER_NAME] cmds: - | - if docker ps | grep -q "{{.CONTAINER_NAME}}"; then + if {{.CONTAINER_RUNTIME}} ps | grep -q "{{.CONTAINER_NAME}}"; then echo "Stopping {{.CONTAINER_NAME}} development container..." - docker stop {{.CONTAINER_NAME}} + {{.CONTAINER_RUNTIME}} stop {{.CONTAINER_NAME}} else echo "Container {{.CONTAINER_NAME}} is not running" fi