Skip to content

Use debian-base as base image #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ MAINTAINER Tim Hockin <[email protected]>

ADD bin/{ARG_OS}_{ARG_ARCH}/{ARG_BIN} /{ARG_BIN}

RUN apk update --no-cache && apk add \
ca-certificates \
coreutils \
git \
openssh-client
RUN apt-get update \
&& apt-get -y install \
ca-certificates \
coreutils \
git \
openssh-client \
&& rm -rf /var/lib/apt/lists/*

RUN echo "git-sync:x:65533:65533::/tmp:/sbin/nologin" >> /etc/passwd

WORKDIR /tmp
USER git-sync:nobody
USER git-sync:nogroup
ENTRYPOINT ["/{ARG_BIN}"]
18 changes: 2 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,13 @@ VERSION := $(shell git describe --tags --always --dirty)

SRC_DIRS := cmd pkg # directories which hold app source (not vendored)

ALL_PLATFORMS := linux/amd64
ALL_PLATFORMS := linux/amd64 linux/arm linux/arm64 linux/ppc64le linux/s390x

# Used internally. Users should pass GOOS and/or GOARCH.
OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS))
ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH))

# TODO: get a baseimage that works for other platforms
# linux/arm linux/arm64 linux/ppc64le

# Set default base image dynamically for each arch
ifeq ($(OS)/$(ARCH),linux/amd64)
BASEIMAGE ?= alpine:3.8
#else ifeq ($(OS)/$(ARCH),linux/arm)
# BASEIMAGE ?= armel/busybox
#else ifeq ($(OS)/$(ARCH),linux/arm64)
# BASEIMAGE ?= aarch64/busybox
#else ifeq ($(OS)/$(ARCH),linux/ppc64le)
# BASEIMAGE ?= ppc64le/busybox
else
$(error Unsupported target platform '$(OS)/$(ARCH)')
endif
BASEIMAGE ?= k8s.gcr.io/debian-base:0.4.1

IMAGE := $(REGISTRY)/$(BIN)
TAG := $(VERSION)__$(OS)_$(ARCH)
Expand Down