Skip to content

Commit 96ba497

Browse files
committed
containertool: Use epoch date in image metadata
1 parent 403e0fe commit 96ba497

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/containertool/containertool.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ enum AllowHTTP: String, ExpressibleByArgument, CaseIterable { case source, desti
144144

145145
// MARK: Create the application configuration
146146

147-
let now = Date.now.ISO8601Format()
147+
let timestamp = Date(timeIntervalSince1970: 0).ISO8601Format()
148148

149149
// Inherit the configuration of the base image - UID, GID, environment etc -
150150
// and override the entrypoint.
@@ -154,7 +154,7 @@ enum AllowHTTP: String, ExpressibleByArgument, CaseIterable { case source, desti
154154
inherited_config.WorkingDir = "/"
155155

156156
let configuration = ImageConfiguration(
157-
created: now,
157+
created: timestamp,
158158
architecture: architecture,
159159
os: os,
160160
config: inherited_config,
@@ -167,7 +167,7 @@ enum AllowHTTP: String, ExpressibleByArgument, CaseIterable { case source, desti
167167
digest(of: tardiff)
168168
] + baseimage_config.rootfs.diff_ids
169169
),
170-
history: [.init(created: now, created_by: "containertool")]
170+
history: [.init(created: timestamp, created_by: "containertool")]
171171
)
172172

173173
let config_blob = try await destination.putImageConfiguration(

0 commit comments

Comments
 (0)