Skip to content

Commit

Permalink
Fixed sidecar running group for arm arch
Browse files Browse the repository at this point in the history
The base image used to build the containers for the arm arch
(both arm and arm64) uses the pair nobody:nogroup while amd64
arch uses nobody:nobody
  • Loading branch information
GheRivero committed Jan 13, 2017
1 parent 3700f98 commit 8dc4d56
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.sidecar
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ MAINTAINER Bowei Du <[email protected]>

ADD bin/ARG_ARCH/ARG_BIN /ARG_BIN

USER nobody:nobody
USER nobody:ARG_NOBODY
ENTRYPOINT ["/ARG_BIN"]
2 changes: 1 addition & 1 deletion Dockerfile.sidecar-e2e
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ MAINTAINER Bowei Du <[email protected]>

ADD bin/ARG_ARCH/ARG_BIN /ARG_BIN

USER nobody:nobody
USER nobody:ARG_NOBODY
ENTRYPOINT ["/ARG_BIN"]
5 changes: 5 additions & 0 deletions rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,19 @@ ALL_ARCH := amd64 arm arm64 ppc64le
# Set default base image dynamically for each arch
ifeq ($(ARCH),amd64)
BASEIMAGE?=alpine
NOBODY?=nobody
endif
ifeq ($(ARCH),arm)
BASEIMAGE?=armel/busybox
NOBODY?=nogroup
endif
ifeq ($(ARCH),arm64)
BASEIMAGE?=aarch64/busybox
NOBODY?=nogroup
endif
ifeq ($(ARCH),ppc64le)
BASEIMAGE?=ppc64le/busybox
NOBODY?=nobody
endif

# These rules MUST be expanded at reference time (hence '=') as BINARY
Expand Down Expand Up @@ -114,6 +118,7 @@ define DOCKERFILE_RULE
-e 's|ARG_BIN|$(BINARY)|g' \
-e 's|ARG_ARCH|$(ARCH)|g' \
-e 's|ARG_FROM|$(BASEIMAGE)|g' \
-e 's|ARG_NOBODY|$(NOBODY)|g' \
$$< > $$@
.$(BUILDSTAMP_NAME)-container: .$(BINARY)-$(ARCH)-dockerfile
endef
Expand Down

0 comments on commit 8dc4d56

Please sign in to comment.