chore(docker): Fix docker image local builds (#4127)

Fixes an artifact leftover from the refactor.

Fixes #4122
This commit is contained in:
Jamil
2024-03-13 17:06:10 -07:00
committed by GitHub
parent 9767bddcca
commit 63c546eb45
4 changed files with 27 additions and 12 deletions

View File

@@ -17,6 +17,16 @@ env:
VERSION: "1.0.0"
jobs:
# Builds images that match what's default in docker-compose.yml for
# local development.
build-dev-images:
uses: ./.github/workflows/_build_artifacts.yml
secrets: inherit
with:
image_prefix: "dev"
stage: "debug"
profile: "debug"
# Re-run CI checks to make sure everything's green, since "Merging as administrator"
# won't trigger these in the merge group.
ci:

View File

@@ -115,14 +115,14 @@ services:
FIREZONE_API_URL: ws://api:8081
init: true
build:
target: debug
target: dev
context: rust
dockerfile: Dockerfile
cache_from:
- type=registry,ref=us-east1-docker.pkg.dev/firezone-staging/cache/client:main
args:
PACKAGE: firezone-linux-client
image: ${CLIENT_IMAGE:-us-east1-docker.pkg.dev/firezone-staging/firezone/debug/client}:${CLIENT_TAG:-main}
image: ${CLIENT_IMAGE:-us-east1-docker.pkg.dev/firezone-staging/firezone/dev/client}:${CLIENT_TAG:-main}
cap_add:
- NET_ADMIN
sysctls:
@@ -146,14 +146,14 @@ services:
FIREZONE_API_URL: ws://api:8081
FIREZONE_ID: 4694E56C-7643-4A15-9DF3-638E5B05F570
build:
target: debug
target: dev
context: rust
dockerfile: Dockerfile
cache_from:
- type=registry,ref=us-east1-docker.pkg.dev/firezone-staging/cache/gateway:main
args:
PACKAGE: firezone-gateway
image: ${GATEWAY_IMAGE:-us-east1-docker.pkg.dev/firezone-staging/firezone/debug/gateway}:${GATEWAY_TAG:-main}
image: ${GATEWAY_IMAGE:-us-east1-docker.pkg.dev/firezone-staging/firezone/dev/gateway}:${GATEWAY_TAG:-main}
cap_add:
- NET_ADMIN
sysctls:
@@ -212,14 +212,14 @@ services:
RUST_BACKTRACE: 1
FIREZONE_API_URL: ws://api:8081
build:
target: debug
target: dev
context: rust
dockerfile: Dockerfile
cache_from:
- type=registry,ref=us-east1-docker.pkg.dev/firezone-staging/cache/relay:main
args:
PACKAGE: firezone-relay
image: ${RELAY_IMAGE:-us-east1-docker.pkg.dev/firezone-staging/firezone/debug/relay}:${RELAY_TAG:-main}
image: ${RELAY_IMAGE:-us-east1-docker.pkg.dev/firezone-staging/firezone/dev/relay}:${RELAY_TAG:-main}
healthcheck:
test: ["CMD-SHELL", "lsof -i UDP | grep firezone-relay"]
start_period: 10s

View File

@@ -125,16 +125,21 @@ ENV PACKAGE=${PACKAGE}
CMD $PACKAGE
# used for local development
FROM runtime as development
FROM runtime as test
RUN set -xe \
&& apk add --no-cache iperf3 bind-tools iproute2 jq
# used for local development
FROM test AS dev
ARG TARGET
COPY --from=builder /build/target/${TARGET}/debug/${PACKAGE} .
# Build an image for GitHub Actions which includes debug asserts and test utilities
FROM development AS debug
FROM test AS debug
ARG TARGET
## Build first with `cross build --target ${TARGET} -p ${PACKAGE} --debug && mv /target/${TARGET}/release/${PACKAGE} .`
## Build first with `cross build --target ${TARGET} -p ${PACKAGE} && mv /target/${TARGET}/release/${PACKAGE} .`
COPY ${PACKAGE} .
# Build a production image from including a binary compiled on the host

View File

@@ -2,18 +2,18 @@
services:
client:
build:
target: development
target: test
volumes:
- ./rust/target/x86_64-unknown-linux-musl/debug/firezone-linux-client:/bin/firezone-linux-client
gateway:
build:
target: development
target: test
volumes:
- ./rust/target/x86_64-unknown-linux-musl/debug/firezone-gateway:/bin/firezone-gateway
relay:
build:
target: development
target: test
volumes:
- ./rust/target/x86_64-unknown-linux-musl/debug/firezone-relay:/bin/firezone-relay