File tree Expand file tree Collapse file tree 5 files changed +42
-13
lines changed Expand file tree Collapse file tree 5 files changed +42
-13
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ FROM shuttle-build AS builder
18
18
COPY --from=planner /build/recipe.json recipe.json
19
19
RUN cargo chef cook --recipe-path recipe.json
20
20
COPY --from=cache /build .
21
- ARG crate
22
- RUN cargo build --bin ${crate }
21
+ ARG folder
22
+ RUN cargo build --bin shuttle-${folder }
23
23
24
24
FROM rust:1.63.0-buster as shuttle-common
25
25
RUN apt-get update &&\
@@ -28,14 +28,8 @@ RUN rustup component add rust-src
28
28
COPY --from=cache /build/ /usr/src/shuttle/
29
29
30
30
FROM shuttle-common
31
- ARG crate
32
- SHELL ["/bin/bash" , "-c" ]
33
- RUN mkdir -p $CARGO_HOME; \
34
- echo $'[patch.crates-io] \n \
35
- shuttle-service = { path = "/usr/src/shuttle/service" } \n \
36
- shuttle-aws-rds = { path = "/usr/src/shuttle/resources/aws-rds" } \n \
37
- shuttle-persist = { path = "/usr/src/shuttle/resources/persist" } \n \
38
- shuttle-shared-db = { path = "/usr/src/shuttle/resources/shared-db" } \n \
39
- shuttle-secrets = { path = "/usr/src/shuttle/resources/secrets" }' > $CARGO_HOME/config.toml
40
- COPY --from=builder /build/target/debug/${crate} /usr/local/bin/service
31
+ ARG folder
32
+ COPY ${folder}/prepare.sh /prepare.sh
33
+ RUN /prepare.sh
34
+ COPY --from=builder /build/target/debug/shuttle-${folder} /usr/local/bin/service
41
35
ENTRYPOINT ["/usr/local/bin/service" ]
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ down: docker-compose.rendered.yml
89
89
90
90
shuttle-% : ${SRC} Cargo.lock
91
91
docker buildx build \
92
- --build-arg crate=shuttle- $(* ) \
92
+ --build-arg folder= $(* ) \
93
93
--tag $(CONTAINER_REGISTRY ) /$(* ) :$(COMMIT_SHA ) \
94
94
--tag $(CONTAINER_REGISTRY ) /$(* ) :$(TAG ) \
95
95
--tag $(CONTAINER_REGISTRY ) /$(* ) :latest \
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env sh
2
+
3
+ # ##############################################################################
4
+ # This file is used by our common Containerfile incase the container for this #
5
+ # service might need some extra preparation steps for its final image #
6
+ # ##############################################################################
7
+
8
+ # Patch crates to be on same versions
9
+ mkdir -p $CARGO_HOME ; \
10
+ echo ' [patch.crates-io]
11
+ shuttle-service = { path = "/usr/src/shuttle/service" }
12
+ shuttle-aws-rds = { path = "/usr/src/shuttle/resources/aws-rds" }
13
+ shuttle-persist = { path = "/usr/src/shuttle/resources/persist" }
14
+ shuttle-shared-db = { path = "/usr/src/shuttle/resources/shared-db" }
15
+ shuttle-secrets = { path = "/usr/src/shuttle/resources/secrets" }' > $CARGO_HOME /config.toml
16
+
17
+ # Prefetch crates.io index
18
+ cd /usr/src/shuttle/service
19
+ cargo fetch
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env sh
2
+
3
+ # ##############################################################################
4
+ # This file is used by our common Containerfile incase the container for this #
5
+ # service might need some extra preparation steps for its final image #
6
+ # ##############################################################################
7
+
8
+ # Nothing to prepare in container image here
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env sh
2
+
3
+ # ##############################################################################
4
+ # This file is used by our common Containerfile incase the container for this #
5
+ # service might need some extra preparation steps for its final image #
6
+ # ##############################################################################
7
+
8
+ # Nothing to prepare in container image here
You can’t perform that action at this time.
0 commit comments