mirror of
https://github.com/apple/container.git
synced 2026-09-21 15:15:36 +00:00
Add test for using previous stages as FROM source (#342)
Depends on https://github.com/apple/container-builder-shim/pull/38 and a new builder image tag Related to https://github.com/apple/container/issues/334 Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
This commit is contained in:
+1
-1
@@ -23,7 +23,7 @@ import PackageDescription
|
||||
let releaseVersion = ProcessInfo.processInfo.environment["RELEASE_VERSION"] ?? "0.0.0"
|
||||
let gitCommit = ProcessInfo.processInfo.environment["GIT_COMMIT"] ?? "unspecified"
|
||||
let scVersion = "0.4.1"
|
||||
let builderShimVersion = "0.3.0"
|
||||
let builderShimVersion = "0.4.0"
|
||||
|
||||
let package = Package(
|
||||
name: "container",
|
||||
|
||||
@@ -47,6 +47,23 @@ extension TestCLIBuildBase {
|
||||
#expect(try self.inspectImage(imageName) == imageName, "expected to have successfully built \(imageName)")
|
||||
}
|
||||
|
||||
@Test func testBuildFromPreviousStage() throws {
|
||||
let tempDir: URL = try createTempDir()
|
||||
let dockerfile =
|
||||
"""
|
||||
FROM ghcr.io/linuxcontainers/alpine:3.20 AS layer1
|
||||
RUN sh -c "echo 'layer1' > /layer1.txt"
|
||||
|
||||
FROM layer1
|
||||
CMD ["cat", "/layer1.txt"]
|
||||
"""
|
||||
|
||||
try createContext(tempDir: tempDir, dockerfile: dockerfile)
|
||||
let imageName = "registry.local/from-previous-layer:\(UUID().uuidString)"
|
||||
try self.build(tag: imageName, tempDir: tempDir)
|
||||
#expect(try self.inspectImage(imageName) == imageName, "expected to have successfully build \(imageName)")
|
||||
}
|
||||
|
||||
@Test func testBuildFromLocalImage() throws {
|
||||
let tempDir: URL = try createTempDir()
|
||||
let dockerfile: String =
|
||||
|
||||
Reference in New Issue
Block a user