diff --git a/Makefile b/Makefile index 0888931..5fbab43 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,11 @@ -BASENAME=devenv +BASENAME=interview IMAGE_NAME=$(BASENAME):latest +MOUNT_DIR=$(shell realpath $(DIR)) + +help: + $(info make build to build the image) + $(info make run PORT= DIR= SECRET=) build: $(info BUILDING IMAGE NAME: $(IMAGE_NAME)) @@ -9,4 +14,26 @@ build: -f Dockerfile . docker image ls $(IMAGE_NAME) +run: check-env + $(info PORT: $(PORT) MOUNT: ${MOUNT_DIR} PASSWORD: $(SECRET)) + docker run -it --rm --name interview \ + -h interview \ + -m 524288000 \ + -e SECRET=$(SECRET) \ + -p ${PORT}:22 \ + -v ${MOUNT_DIR}:/home/ubuntu/interview:ro \ + $(IMAGE_NAME) bash -c read "press Enter to stop" + +check-env: +ifndef PORT + $(error no PORT, run make help) +endif + +ifndef SECRET + $(error no SECRET, run make help) +endif + +ifndef DIR + $(error no DIR, run make help) +endif diff --git a/build_time_scripts.sh b/build_time_scripts.sh index 2cea7e5..5592926 100755 --- a/build_time_scripts.sh +++ b/build_time_scripts.sh @@ -5,7 +5,7 @@ if [ "$(ls $1)" ]; then for script in $1/* do echo "executing $script" - $script + bash $script done else echo "custom scripts directory is empty" diff --git a/custom/010_vanilla_go.sh b/custom/010_vanilla_go.sh old mode 100755 new mode 100644 diff --git a/packages.list b/packages.list index 72a886c..aa4a3fd 100644 --- a/packages.list +++ b/packages.list @@ -12,3 +12,5 @@ tree htop iproute2 openssh-client +vim +nano