Go to file
2024-08-06 15:29:03 +02:00
.gitattributes Sync from SUSE:ALP:Source:Standard:1.0 obs-service-docker_label_helper revision aaa909addea4b68d3143ac9c83073f33 2024-08-06 15:29:03 +02:00
docker_label_helper Sync from SUSE:ALP:Source:Standard:1.0 obs-service-docker_label_helper revision aaa909addea4b68d3143ac9c83073f33 2024-08-06 15:29:03 +02:00
docker_label_helper.service Sync from SUSE:ALP:Source:Standard:1.0 obs-service-docker_label_helper revision aaa909addea4b68d3143ac9c83073f33 2024-08-06 15:29:03 +02:00
obs-service-docker_label_helper.changes Sync from SUSE:ALP:Source:Standard:1.0 obs-service-docker_label_helper revision aaa909addea4b68d3143ac9c83073f33 2024-08-06 15:29:03 +02:00
obs-service-docker_label_helper.spec Sync from SUSE:ALP:Source:Standard:1.0 obs-service-docker_label_helper revision aaa909addea4b68d3143ac9c83073f33 2024-08-06 15:29:03 +02:00
README Sync from SUSE:ALP:Source:Standard:1.0 obs-service-docker_label_helper revision aaa909addea4b68d3143ac9c83073f33 2024-08-06 15:29:03 +02:00
test.sh Sync from SUSE:ALP:Source:Standard:1.0 obs-service-docker_label_helper revision aaa909addea4b68d3143ac9c83073f33 2024-08-06 15:29:03 +02:00

obs-service-docker_label_helper
===============================

This service can be enabled to run during buildtime, when it will edit the
Dockerfile to expand the LABEL instruction.

A new syntax using entry/exit flags has been introduced to provide
compatibility with stock docker build command while allowing to add prefixed
labels based on existing LABEL instructions.

Both new and old syntax are supported, but you should not mix both in the
same Dockerfile.

1 - New syntax using entry/exit flags

Only LABEL between # labelprefix and # endlabelprefix will be considered

Example:

```
FROM opensuse/tumbleweed
# labelprefix=org.opensuse.nano
LABEL org.opencontainers.image.title="Example container"
LABEL org.opencontainers.image.description="This contains nano"
# endlabelprefix
LABEL not.expanded.label="example"
```

expands to

```
FROM opensuse/tumbleweed
LABEL org.opensuse.nano.title="Example container"
LABEL org.opencontainers.image.title="Example container"
LABEL org.opensuse.nano.description="This contains nano"
LABEL org.opencontainers.image.description="This contains nano"
LABEL not.expanded.label="example"
```

2 - Old syntax

Expand the PREFIXEDLABEL instruction.

Example:

```
FROM opensuse/tumbleweed
# labelprefix=org.opensuse.nano
PREFIXEDLABEL org.opencontainers.image.title="Example container"
PREFIXEDLABEL org.opencontainers.image.description="This contains nano"
```

expands to

```
FROM opensuse/tumbleweed
LABEL org.opensuse.nano.title="Example container"
LABEL org.opencontainers.image.title="Example container"
LABEL org.opensuse.nano.description="This contains nano"
LABEL org.opencontainers.image.description="This contains nano"
```