mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-04 08:26:42 +00:00
add support for building from cached images
Signed-off-by: Avi Deitcher <avi@deitcher.net>
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
FROM alpine:3.15
|
||||
|
||||
COPY foo /foo
|
5
test/cases/000_build/040_chained_builds/build1/build.yml
Normal file
5
test/cases/000_build/040_chained_builds/build1/build.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
image: chained-build-image1-test-does-not-exist-anywhere-else-123456789 # this must be used as FROM in the chained image
|
||||
network: true
|
||||
arches:
|
||||
- amd64
|
||||
- arm64
|
1
test/cases/000_build/040_chained_builds/build1/foo
Normal file
1
test/cases/000_build/040_chained_builds/build1/foo
Normal file
@@ -0,0 +1 @@
|
||||
bar
|
@@ -0,0 +1,5 @@
|
||||
# this FROM *must* be updated when changing ../build1; just run `lkt pkg show-tag ../build1` and place it here
|
||||
FROM linuxkit/chained-build-image1-test-does-not-exist-anywhere-else-123456789:ad06eb29c48f0daab0cc2836a1351a053948100c as src
|
||||
FROM alpine:3.15
|
||||
COPY --from=src /foo /foo
|
||||
RUN cat /foo
|
5
test/cases/000_build/040_chained_builds/build2/build.yml
Normal file
5
test/cases/000_build/040_chained_builds/build2/build.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
image: chained-build-test-second
|
||||
network: true
|
||||
arches:
|
||||
- amd64
|
||||
- arm64
|
19
test/cases/000_build/040_chained_builds/test.sh
Executable file
19
test/cases/000_build/040_chained_builds/test.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
# SUMMARY: Check that chained builds get the output of one for the next
|
||||
# LABELS:
|
||||
# REPEAT:
|
||||
|
||||
set -ex
|
||||
|
||||
# Source libraries. Uncomment if needed/defined
|
||||
#. "${RT_LIB}"
|
||||
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
|
||||
|
||||
# Test code goes here
|
||||
echo linuxkit is "$(which linuxkit)"
|
||||
|
||||
# build the first, use it to build the second
|
||||
linuxkit pkg build --force ./build1
|
||||
linuxkit pkg build --force ./build2
|
||||
|
||||
exit 0
|
Reference in New Issue
Block a user