-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add Dockerfile for controller, build with bottlerocket-sdk
Build the binaries with the bottlerocket-sdk.
- Loading branch information
Showing
3 changed files
with
37 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
.PHONY: example-test-agent-container | ||
.PHONY: example-test-agent-container controller-container controller | ||
|
||
# Build a container image for daemon and tools. | ||
ARCH=$(shell uname -m) | ||
|
||
containers: controller-container | ||
|
||
# Build the container image for the example test-agent program | ||
example-test-agent-container: | ||
docker build \ | ||
--network=host \ | ||
--build-arg ARCH="$(ARCH)" \ | ||
--tag 'example_test_agent' \ | ||
-f test-agent/examples/example_test_agent/Dockerfile . | ||
|
||
controller-container: | ||
docker build \ | ||
--network=host \ | ||
--build-arg ARCH="$(ARCH)" \ | ||
--tag 'test-sys-controller' \ | ||
-f controller/Dockerfile . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
ARG ARCH | ||
FROM public.ecr.aws/bottlerocket/bottlerocket-sdk-${ARCH}:v0.22.0 as build | ||
ARG ARCH | ||
USER root | ||
WORKDIR /src | ||
ADD ./ /src/ | ||
WORKDIR /src/controller | ||
RUN cargo install --locked --verbose --target ${ARCH}-bottlerocket-linux-musl --path . --root ./ | ||
|
||
FROM scratch | ||
COPY --from=build /src/controller/bin/controller ./ | ||
|
||
ENTRYPOINT ["./controller"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
# TODO Use Bottlerocket SDK | ||
FROM rust:1.53.0 | ||
ARG ARCH | ||
FROM public.ecr.aws/bottlerocket/bottlerocket-sdk-${ARCH}:v0.22.0 as build | ||
ARG ARCH | ||
USER root | ||
WORKDIR /src | ||
ADD ./ /src/ | ||
WORKDIR /src/test-agent | ||
RUN cargo install --path . --example example_test_agent --root ./ | ||
ENTRYPOINT ["/src/test-agent/bin/example_test_agent"] | ||
RUN cargo install --locked --verbose --target ${ARCH}-bottlerocket-linux-musl --path . --example example_test_agent --root ./ | ||
|
||
FROM scratch | ||
COPY --from=build /src/test-agent/bin/example_test_agent ./ | ||
|
||
ENTRYPOINT ["./example_test_agent"] |