Skip to content

[packagers] Use spec name for directory name in repository #1950

@aalmiray

Description

@aalmiray

Is your feature request related to a problem? Please describe.
Docker supports multiple specs (or variants) however the name of the directory holding each variant is dependent on the image's basename. Thus, multiple variants with the same imageName but different version/tags will share the same directory.

Describe the solution you'd like
Use the spec/variant name instead of the basename to determine the directory to use.

cc: @maxandersen

NOTE: This is a potential breaking change but affected users will be able to fix it by adjusting the names of their specs, for example JReleaser will have to change its release configuration

before

      specs:
        slim:
          imageNames:
            - 'jreleaser/jreleaser-{{dockerSpecName}}:{{tagName}}'
            - 'jreleaser/jreleaser-{{dockerSpecName}}:latest'
          matchers:
            platform: 'linux-x86_64'
          preCommands:
            - 'ARG DEBIAN_FRONTEND=noninteractive'
            - 'ENV TZ=Europe/Zurich'
            - 'RUN apt-get update && apt-get install -y unzip binutils fakeroot rpm git'
        alpine:
          imageNames:
            - 'jreleaser/jreleaser-{{dockerSpecName}}:{{tagName}}'
            - 'jreleaser/jreleaser-{{dockerSpecName}}:latest'
          matchers:
            platform: 'linux_musl-x86_64'
          preCommands:
            - 'RUN apk add unzip binutils fakeroot rpm bash git'

after

      specs:
        jreleaser-slim:
          imageNames:
            - 'jreleaser/{{dockerSpecName}}:{{tagName}}'
            - 'jreleaser/{{dockerSpecName}}:latest'
          matchers:
            platform: 'linux-x86_64'
          preCommands:
            - 'ARG DEBIAN_FRONTEND=noninteractive'
            - 'ENV TZ=Europe/Zurich'
            - 'RUN apt-get update && apt-get install -y unzip binutils fakeroot rpm git'
        jreleaser-alpine:
          imageNames:
            - 'jreleaser/{{dockerSpecName}}:{{tagName}}'
            - 'jreleaser/{{dockerSpecName}}:latest'
          matchers:
            platform: 'linux_musl-x86_64'
          preCommands:
            - 'RUN apk add unzip binutils fakeroot rpm bash git'

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions