Commit b0f3ceb 1 parent ad56bb6 commit b0f3ceb Copy full SHA for b0f3ceb
File tree 3 files changed +33
-8
lines changed
3 files changed +33
-8
lines changed Original file line number Diff line number Diff line change 26
26
google_service_account : gh-texas
27
27
push : true
28
28
push_ghcr : true
29
+ multi-platform : ' true'
29
30
workload_identity_provider : ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }}
Original file line number Diff line number Diff line change 1
- FROM rust:alpine AS builder
2
- RUN apk add musl-dev
3
- COPY . /src
4
- WORKDIR /src
5
- RUN cargo build --release
1
+ FROM --platform=$BUILDPLATFORM rust:1 as builder
2
+
3
+ WORKDIR /build
4
+ ARG TARGETPLATFORM
5
+ RUN \
6
+ set -eux ; \
7
+ if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
8
+ apt-get --yes update && apt-get --yes install cmake musl-tools ; \
9
+ rustup target add x86_64-unknown-linux-musl ; \
10
+ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
11
+ apt-get --yes update && apt-get --yes install cmake musl-tools gcc-aarch64-linux-gnu ; \
12
+ rustup target add aarch64-unknown-linux-musl ; \
13
+ fi
14
+
15
+ COPY . .
16
+
17
+ RUN \
18
+ set -eux ; \
19
+ if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
20
+ export TARGET=x86_64-unknown-linux-musl ; \
21
+ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
22
+ export TARGET=aarch64-unknown-linux-musl ; \
23
+ export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc ; \
24
+ export CC_aarch64_unknown_linux_musl=aarch64-linux-gnu-gcc ; \
25
+ export CXX_aarch64_unknown_linux_musl=aarch64-linux-gnu-g++ ; \
26
+ fi ; \
27
+ cargo test --release --target ${TARGET} -- --test-threads 1 ; \
28
+ cargo build --release --target ${TARGET} && mkdir -p target/final/release/ && mv target/${TARGET}/release/texas target/final/release/texas ; \
29
+ file target/final/release/texas
6
30
7
31
FROM gcr.io/distroless/static-debian12:nonroot
8
32
WORKDIR /app
9
- COPY --from=builder /src /target/release/texas /app/texas
33
+ COPY --from=builder /build /target/final /release/texas /app/texas
10
34
CMD ["/app/texas" ]
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ pub mod config {
17
17
#[ command( version, about, long_about = None ) ]
18
18
pub struct Config {
19
19
#[ arg( short, long, env, default_value = "127.0.0.1:3000" ) ]
20
- pub bind_address : String ,
20
+ pub bind_addr : String ,
21
21
#[ arg( env) ]
22
22
pub maskinporten_client_id : String ,
23
23
#[ arg( env) ]
@@ -72,7 +72,7 @@ async fn main() {
72
72
. route ( "/token" , post ( handlers:: token) ) . with_state ( state. clone ( ) )
73
73
. route ( "/introspection" , post ( handlers:: introspection) . with_state ( state. clone ( ) ) ) ;
74
74
75
- let listener = tokio:: net:: TcpListener :: bind ( cfg. bind_address ) . await . unwrap ( ) ;
75
+ let listener = tokio:: net:: TcpListener :: bind ( cfg. bind_addr ) . await . unwrap ( ) ;
76
76
77
77
info ! ( "Serving on {:?}" , listener. local_addr( ) . unwrap( ) ) ;
78
78
You can’t perform that action at this time.
0 commit comments