Skip to content

Commit

Permalink
Add NICE and IONICE into distroless image (#883)
Browse files Browse the repository at this point in the history
  • Loading branch information
hossainemruz authored and tamalsaha committed Sep 2, 2019
1 parent f63d5c1 commit 88c8427
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Dockerfile.dbg
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ COPY --from=0 restic /bin/restic
COPY --from=0 restic_{NEW_RESTIC_VER} /bin/restic_{NEW_RESTIC_VER}
COPY bin/{ARG_OS}_{ARG_ARCH}/{ARG_BIN} /{ARG_BIN}

# Copy "nice" and "ionice".
COPY --from=0 /usr/bin/nice /bin/nice
COPY --from=0 /usr/bin/ionice /bin/ionice

ENTRYPOINT ["/{ARG_BIN}"]
4 changes: 4 additions & 0 deletions Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ COPY --from=0 /restic /bin/restic
COPY --from=0 /restic_{NEW_RESTIC_VER} /bin/restic_{NEW_RESTIC_VER}
COPY bin/{ARG_OS}_{ARG_ARCH}/{ARG_BIN} /{ARG_BIN}

# Copy "nice" and "ionice".
COPY --from=0 /usr/bin/nice /bin/nice
COPY --from=0 /usr/bin/ionice /bin/ionice

# This would be nicer as `nobody:nobody` but distroless has no such entries.
USER 65535:65535

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ BIN_PLATFORMS := $(DOCKER_PLATFORMS) windows/amd64 darwin/amd64
OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS))
ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH))

BASEIMAGE_PROD ?= gcr.io/distroless/static
BASEIMAGE_PROD ?= gcr.io/distroless/base
BASEIMAGE_DBG ?= debian:stretch

IMAGE := $(REGISTRY)/$(BIN)
Expand Down

0 comments on commit 88c8427

Please sign in to comment.