mirror of
https://github.com/phusion/baseimage-docker.git
synced 2026-03-26 04:18:46 +00:00
build-arg to define base-image, fix locale for Debian
This commit is contained in:
15
Makefile
15
Makefile
@@ -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
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
FROM ubuntu:18.04
|
||||
ARG BASE_IMAGE
|
||||
FROM $BASE_IMAGE
|
||||
MAINTAINER Phusion <info@phusion.nl>
|
||||
|
||||
COPY . /bd_build
|
||||
|
||||
@@ -41,7 +41,16 @@ $minimal_apt_get_install software-properties-common
|
||||
apt-get dist-upgrade -y --no-install-recommends -o Dpkg::Options::="--force-confold"
|
||||
|
||||
## Fix locale.
|
||||
case $(lsb_release -is) in
|
||||
Ubuntu)
|
||||
$minimal_apt_get_install language-pack-en
|
||||
;;
|
||||
Debian)
|
||||
$minimal_apt_get_install locales locales-all
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
locale-gen en_US
|
||||
update-locale LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8
|
||||
echo -n en_US.UTF-8 > /etc/container_environment/LANG
|
||||
|
||||
Reference in New Issue
Block a user