Skip to content

Commit a75abac

Browse files
authored
Default to Podman, allow Docker optionally (#54)
Signed-off-by: Scott Rigby <[email protected]>
1 parent 0da51be commit a75abac

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

applications/wg-easy/Taskfile.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ vars:
2828
GCP_ZONE: '{{.GCP_ZONE | default "us-central1-a"}}'
2929
VM_NAME: '{{.VM_NAME | default (printf "%s-dev" (or (env "GUSER") "user"))}}'
3030

31-
# Docker workflow configuration
31+
# Container workflow configuration
3232
IMAGE_NAME: ttl.sh/wg-easy-dev
3333
CONTAINER_NAME: wg-easy-dev
34+
CONTAINER_RUNTIME: '{{.CONTAINER_RUNTIME | default "podman"}}'
3435

3536
tasks:
3637
default:

applications/wg-easy/container/Containerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Base image for all shared Dockerfiles for taskfiles
2-
# Use this image as base image for app specific docker files
1+
# Base image for all shared Containerfiles for taskfiles
2+
# Use this image as base image for app specific container files
33
FROM --platform=$BUILDPLATFORM ubuntu:24.04
44

55
ARG TARGETOS

applications/wg-easy/docs/development-workflow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ The core philosophy of this workflow is to start simple and add complexity incre
1818
Before starting the development workflow, ensure you have the following tools installed:
1919

2020
- **Task:** The task runner used in this project. ([Installation Guide](https://taskfile.dev/installation/))
21-
- **Docker:** Container runtime for local development. ([Installation Guide](https://docs.docker.com/get-docker/))
21+
- **Container runtime tool** Either [Podman](https://podman.io/docs/installation) (default) or [Docker](https://docs.docker.com/get-docker/) for local development
2222

23-
All other tools will be automatically provided through task commands and Docker containers.
23+
All other tools will be automatically provided through task commands and containers.
2424

2525
## Workflow Stages
2626

applications/wg-easy/taskfiles/container.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: "3"
33
# Development environment tasks
44
tasks:
55
build-image:
6-
desc: Build development Docker image
6+
desc: Build development container image
77
vars:
88
IMAGE_NAME: '{{.IMAGE_NAME}}'
99
IMAGE_TAG: '{{.IMAGE_TAG | default "latest"}}'
@@ -13,7 +13,7 @@ tasks:
1313
vars: [IMAGE_NAME, IMAGE_TAG, CONTAINERFILE]
1414

1515
cmds:
16-
- docker build -t {{.IMAGE_NAME}} -f {{.CONTAINERFILE}} .
16+
- '{{.CONTAINER_RUNTIME}} build -t {{.IMAGE_NAME}} -f {{.CONTAINERFILE}} .'
1717

1818
start:
1919
desc: Start development container in background
@@ -36,11 +36,11 @@ tasks:
3636
vars: [IMAGE_NAME, CONTAINER_NAME, REPLICATED_API_TOKEN]
3737

3838
status:
39-
- docker ps | grep -q "{{.CONTAINER_NAME}}"
39+
- '{{.CONTAINER_RUNTIME}} ps | grep -q "{{.CONTAINER_NAME}}"'
4040
cmds:
4141
- |
4242
# Start container with host networking for kubectl port-forward compatibility
43-
CONTAINER_ID=$(docker run --rm --name {{.CONTAINER_NAME}} -d \
43+
CONTAINER_ID=$({{.CONTAINER_RUNTIME}} run --rm --name {{.CONTAINER_NAME}} -d \
4444
-v $(pwd):/workspace \
4545
-e HOME=/home/devuser \
4646
-e USER=devuser \
@@ -64,7 +64,7 @@ tasks:
6464
- start-implementation
6565
cmds:
6666
- echo "Connecting to {{.CONTAINER_NAME}}..."
67-
- docker exec -it {{.CONTAINER_NAME}} /bin/bash
67+
- '{{.CONTAINER_RUNTIME}} exec -it {{.CONTAINER_NAME}} /bin/bash'
6868

6969
stop:
7070
desc: Stop development container
@@ -73,9 +73,9 @@ tasks:
7373
vars: [CONTAINER_NAME]
7474
cmds:
7575
- |
76-
if docker ps | grep -q "{{.CONTAINER_NAME}}"; then
76+
if {{.CONTAINER_RUNTIME}} ps | grep -q "{{.CONTAINER_NAME}}"; then
7777
echo "Stopping {{.CONTAINER_NAME}} development container..."
78-
docker stop {{.CONTAINER_NAME}}
78+
{{.CONTAINER_RUNTIME}} stop {{.CONTAINER_NAME}}
7979
else
8080
echo "Container {{.CONTAINER_NAME}} is not running"
8181
fi

0 commit comments

Comments
 (0)