Skip to content

Commit 936eb8f

Browse files
committed
better way to pull
1 parent 820eb62 commit 936eb8f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Plugins/AWSLambdaPackager/Plugin.swift

+9-1
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,19 @@ struct AWSLambdaPackager: CommandPlugin {
8686
print("building \"\(packageIdentity)\" in docker")
8787
print("-------------------------------------------------------------------------")
8888

89+
// update the underlying docker image, if necessary
90+
print("updating \"\(baseImage)\" docker image")
91+
try self.execute(
92+
executable: dockerToolPath,
93+
arguments: ["pull", baseImage],
94+
logLevel: .output
95+
)
96+
8997
// get the build output path
9098
let buildOutputPathCommand = "swift build -c \(buildConfiguration.rawValue) --show-bin-path"
9199
let dockerBuildOutputPath = try self.execute(
92100
executable: dockerToolPath,
93-
arguments: ["run", "--rm", "--pull", "always", "-v", "\(packageDirectory.string):/workspace", "-w", "/workspace", baseImage, "bash", "-cl", buildOutputPathCommand],
101+
arguments: ["run", "--rm", "-v", "\(packageDirectory.string):/workspace", "-w", "/workspace", baseImage, "bash", "-cl", buildOutputPathCommand],
94102
logLevel: verboseLogging ? .debug : .silent
95103
)
96104
guard let buildPathOutput = dockerBuildOutputPath.split(separator: "\n").last else {

0 commit comments

Comments
 (0)