Files
podman/docs/source/markdown/podman-artifact-add.1.md.in
Daniel J Walsh 4764b0e403 Add creation timestamp to podman artifacts
This commit implements automatic creation timestamp functionality for artifacts
as requested in GitHub issue #27081, allowing users to see when artifacts were created.

Changes made:
- Add org.opencontainers.image.created annotation with Unix nanoseconds timestamp during artifact creation
- Preserve original creation timestamp when using --append option
- Update artifact inspect and add man pages to document the new functionality
- Add comprehensive e2e and system BATS tests to verify creation timestamp behavior
- Store timestamp as integer (Unix nanoseconds) for programmatic access

The creation timestamp helps users understand artifact freshness, particularly
useful for AI models and other time-sensitive artifacts managed by tools like RamaLama.

Usage examples:
  podman artifact add myartifact:latest /path/to/file     # Creates with timestamp
  podman artifact inspect myartifact:latest              # Shows created annotation as integer
  podman artifact add --append myartifact:latest /file2  # Preserves original timestamp

Fixes: https://github.com/containers/podman/issues/27081
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2025-09-25 08:39:28 -04:00

78 lines
1.9 KiB
Markdown

% podman-artifact-add 1
## NAME
podman\-artifact\-add - Add an OCI artifact to the local store
## SYNOPSIS
**podman artifact add** *name* *file* [*file*]...
## DESCRIPTION
Add an OCI artifact to the local store from the local filesystem. You must
provide at least one file to create the artifact, but several can also be
added.
Artifacts automatically include a creation timestamp in the
`org.opencontainers.image.created` annotation using RFC3339Nano format. When using
the `--append` option, the original creation timestamp is preserved.
## OPTIONS
@@option annotation.manifest
Note: Set annotations for each file being added.
#### **--append**, **-a**
Append files to an existing artifact. This option cannot be used with the **--type** option.
#### **--file-type**
Set the media type of the artifact file instead of allowing detection to determine the type
#### **--help**
Print usage statement.
#### **--type**
Set a type for the artifact being added.
## EXAMPLES
Add a single file to an artifact
```
$ podman artifact add quay.io/myartifact/myml:latest /tmp/foobar.ml
0fe1488ecdef8cc4093e11a55bc048d9fc3e13a4ba846efd24b5a715006c95b3
```
Add multiple files to an artifact
```
$ podman artifact add quay.io/myartifact/myml:latest /tmp/foobar1.ml /tmp/foobar2.ml
1487acae11b5a30948c50762882036b41ac91a7b9514be8012d98015c95ddb78
```
Set an annotation for an artifact
```
$ podman artifact add --annotation date=2025-01-30 quay.io/myartifact/myml:latest /tmp/foobar1.ml
```
Append a file to an existing artifact
```
$ podman artifact add --append quay.io/myartifact/tarballs:latest /tmp/foobar.tar.gz
```
Override the media type of the artifact being added
```
$ podman artifact add --file-type text/yaml quay.io/myartifact/descriptors:latest /tmp/info.yaml
```
## SEE ALSO
**[podman(1)](podman.1.md)**, **[podman-artifact(1)](podman-artifact.1.md)**
## HISTORY
Jan 2025, Originally compiled by Brent Baude <bbaude@redhat.com>