add support for building from cached images

Signed-off-by: Avi Deitcher <avi@deitcher.net>
This commit is contained in:
Avi Deitcher
2022-07-01 15:23:28 +03:00
parent 44dfac2725
commit a90ff542cd
31 changed files with 734 additions and 175 deletions

View File

@@ -0,0 +1,3 @@
FROM alpine:3.15
COPY foo /foo

View 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

View File

@@ -0,0 +1 @@
bar

View File

@@ -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

View File

@@ -0,0 +1,5 @@
image: chained-build-test-second
network: true
arches:
- amd64
- arm64

View 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