diff --git a/.devcontainer.json b/.devcontainer.json index a1447f1..ac711b7 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -1,3 +1,3 @@ { - "build": { "dockerfile": "Dockerfile" } + "image": "ci.virintox.com/spfn/rust-nex/dev-container:latest" } diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 02de8a8..24011c9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,14 +8,14 @@ variables: stages: - test - build-and-push-image - - push-retagged-branch - - push-retagged-latest build-and-push-image: stage: build-and-push-image script: - git submodule update --init - podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - podman build -t "$CI_REGISTRY_IMAGE/dev-container:latest" --target=dev-container . + - podman push "$CI_REGISTRY_IMAGE/dev-container:latest" - podman build -t "$CI_REGISTRY_IMAGE/node-holder:$CI_COMMIT_SHORT_SHA" --target=node-holder . - podman build -t "$CI_REGISTRY_IMAGE/proxy-secure-v1:$CI_COMMIT_SHORT_SHA" --target=proxy-secure-v1 . - podman build -t "$CI_REGISTRY_IMAGE/proxy-insecure-v1:$CI_COMMIT_SHORT_SHA" --target=proxy-insecure-v1 . @@ -25,4 +25,4 @@ build-and-push-image: - podman push "$CI_REGISTRY_IMAGE/proxy-secure-v1:$CI_COMMIT_SHORT_SHA" - podman push "$CI_REGISTRY_IMAGE/proxy-insecure-v1:$CI_COMMIT_SHORT_SHA" - podman push "$CI_REGISTRY_IMAGE/backend-auth:$CI_COMMIT_SHORT_SHA" - - podman push "$CI_REGISTRY_IMAGE/backend-secure:$CI_COMMIT_SHORT_SHA" \ No newline at end of file + - podman push "$CI_REGISTRY_IMAGE/backend-secure:$CI_COMMIT_SHORT_SHA" diff --git a/Dockerfile b/Dockerfile index 4463896..c3b8a2c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM rust:alpine AS dev-container RUN apk add --no-cache protobuf-dev git musl-dev lld openssl-dev openssl-libs-static -FROM dev-container AS builder +FROM build-container AS builder WORKDIR /app @@ -36,4 +36,5 @@ COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/backend_server ENTRYPOINT ["/backend_server_secure"] # make sure the final output container is the dev container so that we can use it from the devcontainer.json -FROM dev-container AS final +FROM build-container AS dev-container +RUN apk add openjdk21-jdk gcompat