Skip to content

Commit

Permalink
Add debugger and releaser bake targets
Browse files Browse the repository at this point in the history
  • Loading branch information
ruffsl committed Jun 4, 2024
1 parent 6c51f87 commit 8911dd1
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
ARG DEV_FROM_STAGE=tooler
ARG EXPORT_FROM_STAGE=builder
ARG PREP_FROM_STAGE=runner
ARG SHIP_FROM_STAGE=runner
ARG WS_CACHE_ID=nav2

ARG FROM_IMAGE=base
Expand Down Expand Up @@ -263,3 +264,22 @@ RUN --mount=type=cache,id=$WS_CACHE_ID,sharing=private,target=$OVERLAY_WS,readon
FROM $EXPORT_FROM_STAGE as exporter

COPY --link --from=dancer /dancer/$OVERLAY_WS $OVERLAY_WS

################################################################################
# MARK: shipper - setup production images using shared instructions
################################################################################
FROM $SHIP_FROM_STAGE as shipper

################################################################################
# MARK: debugger - stage target for debuggin in production
################################################################################
FROM shipper as debugger

COPY --link --from=dancer /dancer/$OVERLAY_WS $OVERLAY_WS

################################################################################
# MARK: releaser - stage target for releasing in production
################################################################################
FROM shipper as releaser

COPY --link --from=dancer /dancer/$OVERLAY_WS/install $OVERLAY_WS/install
35 changes: 35 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,38 @@ target "exporter" {
target = "exporter"
tags = ["nav2:exporter"]
}

################################################################################
// MARK: Production targets
################################################################################

target "shipper" {
inherits = ["dancer"]
target = "shipper"
args = {
}
}

target "releaser" {
inherits = ["shipper"]
target = "releaser"
tags = ["nav2:releaser"]
args = {
SHIP_FROM_STAGE = "runner",
}
cache-from = [
// "type=registry,ref=${registry}/${repo}:main-releaser.cache",
]
}

target "debugger" {
inherits = ["shipper"]
target = "debugger"
tags = ["nav2:debugger"]
args = {
SHIP_FROM_STAGE = "tooler",
}
cache-from = [
// "type=registry,ref=${registry}/${repo}:main-debugger.cache",
]
}

0 comments on commit 8911dd1

Please sign in to comment.