39 lines
888 B
Makefile
39 lines
888 B
Makefile
container := "scripts-shell"
|
|
image := "scripts-shell"
|
|
|
|
# Build the container image from Containerfile
|
|
build:
|
|
podman build -t {{image}} .
|
|
|
|
# Start existing container or create if it doesn't exist
|
|
up:
|
|
podman start {{container}} || just create
|
|
|
|
# Create a new detached container
|
|
create:
|
|
podman run -dit \
|
|
--name {{container}} \
|
|
-v $HOME/repos/shell:/opt/scripts:z \
|
|
{{image}}
|
|
|
|
# Open interactive shell in running container
|
|
shell:
|
|
@podman start {{container}} >/dev/null 2>&1 || true
|
|
podman exec -it {{container}} bash
|
|
|
|
# Stop container immediately (SIGKILL, no wait)
|
|
down:
|
|
podman stop -t 0 {{container}}
|
|
|
|
# Force-remove container from system
|
|
rm:
|
|
podman rm -f {{container}}
|
|
|
|
# Restart container
|
|
restart:
|
|
podman restart {{container}}
|
|
|
|
# Show container status (running or stopped)
|
|
status:
|
|
podman ps -a --filter name={{container}}
|