Skip to content
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

perapp: Simplify Makefile #3539

Merged
merged 1 commit into from
Dec 17, 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
12 changes: 4 additions & 8 deletions docker/perapp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,20 @@ clean:
docker image prune -f

# Base images
BASE_TARGETS = app_builder debug_base
BASE_TARGETS = app_builder
.PHONY: $(BASE_TARGETS)
base: $(BASE_TARGETS)

app_builder: hashes/app_builder
hashes/app_builder: base/Dockerfile.builder hashes/scion
DOCKER_ARGS="$(DOCKER_ARGS)" ./docker_build $@ $< files/

debug_base: hashes/debug_base
hashes/debug_base: base/Dockerfile.debug hashes/scion
DOCKER_ARGS="$(DOCKER_ARGS)" ./docker_build $@ $< files/

# App images
APP_TARGETS = bazel
.PHONY: $(APP_TARGETS)
apps: $(APP_TARGETS)

bazel: ../_build/scion.stamp
bazel:
./build-images.sh prod
DOCKER_ARGS="$(DOCKER_ARGS)" ./docker_build hashes/sig app/Dockerfile.sig

Expand All @@ -44,6 +40,6 @@ DEBUG_TARGETS = bazel_debug
.PHONY: $(DEBUG_TARGETS)
debug: $(DEBUG_TARGETS)

bazel_debug: ../_build/scion.stamp debug_base
bazel_debug:
./build-images.sh debug
DOCKER_ARGS="$(DOCKER_ARGS)" ./docker_build hashes/sig_debug app/Dockerfile.sig
DOCKER_ARGS="$(DOCKER_ARGS)" ./docker_build hashes/sig_debug debug/Dockerfile.sig
22 changes: 0 additions & 22 deletions docker/perapp/base/Dockerfile.debug

This file was deleted.

11 changes: 9 additions & 2 deletions docker/perapp/debug/Dockerfile.sig
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
FROM scion_sig:latest
COPY --from=scion_debug_base:latest / /
# Bazel doesn't have support for adding capabilities to binaries.
# Instead, we create a layer on top of bazel-generated image that
# adds the capabilities as needed.
# For alternative ideas on how to solve this see:
# https://github.com/bazelbuild/rules_docker/issues/752
# NOTE: this process needs explicit CAP_NET_ADMIN from docker.
# E.g. with `cap_add: NET_ADMIN` from docker-compose.
FROM scion_sig_nocap_debug:latest
RUN ["setcap", "cap_net_admin+ei", "/app/sig"]