Makefile 845 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
# If the first argument is "run"...
ifeq (run,$(firstword $(MAKECMDGOALS)))
  # use the rest as arguments for "run"
  RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
  # ...and turn them into do-nothing targets
  $(eval $(RUN_ARGS):;@:)
endif

.PHONY: build run

# Default values for variables
Olivier Berger's avatar
Olivier Berger committed
12
REPO  ?= olberger/debian-x11-guacamole-bridge
13 14 15 16 17 18 19 20 21 22 23
TAG   ?= latest
#THEUSER ?= labtainer
#THEPASSWORD ?= labtainer

# Rebuild the container image
build:
	docker build -t $(REPO):$(TAG) .

# Test run the container
#  the local dir will be mounted under /src read-only
run:
24
	docker run --rm -it --name guacamole-labtainer-test -p 8080:8080 -e VNC_PASSWORD=toto123 $(REPO):$(TAG)
25 26 27 28 29 30 31 32 33 34 35

shell:
	docker exec -it guacamole-labtainer-test /bin/bash

push:
	docker push $(REPO):$(TAG)

extra-clean:
	docker rmi $(REPO):$(TAG)
	docker image prune -f