Replies: 1 comment
-
I've documented this information if you'd like to understand that part of the action better. I assume the snippet you shared is only meant to represent your flavor: |
latest=false
suffix=-slimThen manually append or prepend a I can't recall if you can opt-out of a suffix, so the other approach would be: flavor: |
latest=false
tags: |
type=ref,event=branch,suffix=-slim
type=ref,event=pr,suffix=-slim
type=semver,pattern={{version}},suffix=-slim
type=semver,pattern={{major}}.{{minor}},suffix=-slim
type=semver,pattern={{major}},suffix=-slimYou could also take the non-slim tags and process them with either Docker Bake HCL (and use the equivalent - name: Create image tags for the slim variant
id: image-tags-slim
uses: actions/github-script@v8
env:
JSON_IMAGE_METADATA: ${{ steps.image-metadata.outputs.json }}
UNTAGGED_IMAGE_REF: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
with:
script: |
const tags = JSON.parse(process.env.JSON_IMAGE_METADATA).tags
const add_tag = (tag) => `${process.env.UNTAGGED_IMAGE_REF}:${ tag }`
const variant = 'slim'
const tag_list = tags.map(tag => {
if tag.endsWith(':latest') {
return add_tag(`${ variant }`)
} else {
return `${ tag }-${ variant }`
}
})
await core.group(`Prepared ${ tag_list.length } tags`, async () => {
tag_list.forEach(tag => core.info(tag))
})
return tag_list.join(',')Then you can use |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a project where I build two images:
-slimFor that, I have the following configuration:
However, for the latest tag on the slim version, I’m getting
latest-slim. Instead, I would like this tag to be simplyslimfor the latest version of the slim image.How can I adjust my configuration to achieve this?
Beta Was this translation helpful? Give feedback.
All reactions