mirror of
https://github.com/tonistiigi/xx
synced 2025-12-24 12:47:51 +08:00
hack: fix dev-shell script
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
@@ -6,6 +6,14 @@ variable "TEST_BASE_TYPE" {
|
||||
default = "alpine"
|
||||
}
|
||||
|
||||
variable "TEST_BASE_IMAGE" {
|
||||
default = TEST_BASE_TYPE == "alpine" ? "alpine:3.19" : TEST_BASE_TYPE == "debian" ? "debian:bookworm" : null
|
||||
}
|
||||
|
||||
variable "DEV_SDK_PLATFORM" {
|
||||
default = null
|
||||
}
|
||||
|
||||
// Special target: https://github.com/docker/metadata-action#bake-definition
|
||||
target "meta-helper" {
|
||||
tags = ["${XX_REPO}:test"]
|
||||
@@ -169,6 +177,11 @@ target "sdk-extras" {
|
||||
]
|
||||
}
|
||||
|
||||
target "sdk-extras-dev" {
|
||||
inherits = ["sdk-extras"]
|
||||
platforms = DEV_SDK_PLATFORM == null ? null : [ DEV_SDK_PLATFORM ]
|
||||
}
|
||||
|
||||
target "_ld-base" {
|
||||
context = "src/ld"
|
||||
contexts = {
|
||||
@@ -310,3 +323,20 @@ target "libcxx" {
|
||||
"linux/arm64",
|
||||
]
|
||||
}
|
||||
|
||||
target "dev" {
|
||||
context = "src"
|
||||
target = "dev"
|
||||
contexts = {
|
||||
"tonistiigi/xx" = "target:xx"
|
||||
"sdk-extras" = DEV_SDK_PLATFORM != null ? "target:sdk-extras-dev" : "docker-image://scratch"
|
||||
}
|
||||
args = {
|
||||
TEST_BASE_TYPE = TEST_BASE_TYPE
|
||||
TEST_BASE_IMAGE = TEST_BASE_IMAGE
|
||||
}
|
||||
tags = [ "${XX_REPO}:dev" ]
|
||||
output = [
|
||||
"type=docker"
|
||||
]
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
docker buildx build --load -t tonistiigi/xx:dev --build-arg TEST_BASE_TYPE --build-arg TEST_BASE_IMAGE --build-arg TEST_WITH_DARWIN --target=dev ./base
|
||||
docker buildx bake dev
|
||||
|
||||
if ! docker volume inspect xx-pkg-cache >/dev/null 2>&1; then
|
||||
docker volume create xx-pkg-cache >/dev/null 2>&1
|
||||
|
||||
@@ -101,8 +101,8 @@ FROM scratch AS sdk-extras
|
||||
|
||||
# dev can be used for debugging during development
|
||||
FROM test-base AS dev
|
||||
COPY --from=sdk-extras / /
|
||||
COPY --from=xx / /
|
||||
COPY --link --from=sdk-extras / /
|
||||
COPY --link --from=xx / /
|
||||
COPY fixtures fixtures
|
||||
COPY *.bats test_helper.bash ./
|
||||
|
||||
|
||||
Reference in New Issue
Block a user