1
0
mirror of https://github.com/phusion/baseimage-docker.git synced 2026-03-25 20:07:55 +00:00

build-arg to define base-image, fix locale for Debian

This commit is contained in:
Matyas Markovics
2019-03-12 23:28:58 +01:00
parent 14394bcb3f
commit 4f65f0a270
3 changed files with 23 additions and 6 deletions

View File

@@ -1,12 +1,19 @@
NAME = phusion/baseimage
VERSION = 0.11
NAME ?= phusion/baseimage
VERSION ?= 0.11
ifeq ($(origin BASE_IMAGE), undefined)
BASE_IMAGE = ubuntu:18.04
else
NAME := $(NAME)-$(subst :,-,${BASE_IMAGE})
endif
.PHONY: all build test tag_latest release ssh
all: build
build:
docker build -t $(NAME):$(VERSION) --rm image
docker build -t $(NAME):$(VERSION) --build-arg BASE_IMAGE=$(BASE_IMAGE) --rm image
test:
env NAME=$(NAME) VERSION=$(VERSION) ./test/runner.sh
@@ -23,7 +30,7 @@ ssh:
chmod 600 image/services/sshd/keys/insecure_key
@ID=$$(docker ps | grep -F "$(NAME):$(VERSION)" | awk '{ print $$1 }') && \
if test "$$ID" = ""; then echo "Container is not running."; exit 1; fi && \
IP=$$(docker inspect $$ID | grep IPAddr | sed 's/.*: "//; s/".*//') && \
IP=$$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $$ID) && \
echo "SSHing into $$IP" && \
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i image/services/sshd/keys/insecure_key root@$$IP