Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(docker): Support multi-arch images through docker buildkit #556

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Dav1dde
Copy link
Member

@Dav1dde Dav1dde commented Sep 20, 2024

When available uses docker buildkit to copy images, this also handles multi arch images correctly.

Fixes: #541

@Dav1dde
Copy link
Member Author

Dav1dde commented Sep 20, 2024

Not easy to test craft ... but it works!

The uploaded image:
image

The publish output:

dav1d-relay-one :: ~/test ‹release/24.9.0*› » ../craft/dist/craft --log-level=Trace publish --no-merge --keep-branch 24.9.0 --no-status-check
› craft 1.23.0-dev.0                                                                                                                                                                 10:09:46
› No environment file found in the home directory: /home/david_herberth_sentry_io/.craft.env                                                                                         10:09:46
› No environment file found in the configuration directory: /home/david_herberth_sentry_io/test/.craft.env                                                                           10:09:46
› Not initializing Sentry SDK - no valid DSN found in environment or config files                                                                                                    10:09:46
› Configuration file found:  /home/david_herberth_sentry_io/test/.craft.yml                                                                                                          10:09:46
› Parsing and validating the configuration file...                                                                                                                                   10:09:46
› No minimal version specified in the configuration, skpipping the check                                                                                                             10:09:46
› Global flags: {                                                                                                                                                                    10:09:46
  'dry-run': false,
  'no-input': false,
  'log-level': 'Trace'
}
› Argv:  {                                                                                                                                                                           10:09:46
  _: [
    'publish'
  ],
  'log-level': 'Trace',
  logLevel: 'Trace',
  'no-merge': true,
  noMerge: true,
  'keep-branch': true,
  keepBranch: true,
  'no-status-check': true,
  noStatusCheck: true,
  'no-input': false,
  noInput: false,
  'dry-run': false,
  dryRun: false,
  target: 'all',
  t: 'all',
  remote: 'origin',
  'keep-downloads': false,
  keepDownloads: false,
  '$0': '../craft/dist/craft',
  'NEW-VERSION': '24.9.0',
  newVersion: '24.9.0',
  'new-version': '24.9.0',
  'N-e-w--v-e-r-s-i-o-n': '24.9.0'
}
› Catching Ctrl-C is disabled by default. See https://github.com/getsentry/craft/issues/21                                                                                           10:09:46
ℹ Publishing version: "24.9.0"                                                                                                                                                       10:09:46
› Working directory: /home/david_herberth_sentry_io/test                                                                                                                             10:09:46
› Checking out release branch release/24.9.0                                                                                                                                         10:09:46
› Revision to publish:  113bf87040150ff404b26ca95c09ddd3c7a8c65b                                                                                                                     10:09:46
› Using "github" for status checks                                                                                                                                                   10:09:46
› Using "none" for artifacts                                                                                                                                                         10:09:46

 WARN  Skipping build status checks for revision 113bf87040150ff404b26ca95c09ddd3c7a8c65b                                                                                            10:09:46

› Fetching artifact list for revision 113bf87040150ff404b26ca95c09ddd3c7a8c65b.                                                                             [artifact-provider/none] 10:09:46
ℹ No artifacts found for revision 113bf87040150ff404b26ca95c09ddd3c7a8c65b                                                                                  [artifact-provider/none] 10:09:46

 WARN  No artifacts found for the revision.                                                                                                                                          10:09:46

ℹ Looking for publish state file for 24.9.0...                                                                                                                                       10:09:46
› Initializing targets                                                                                                                                                               10:09:46
› Creating target docker[release]                                                                                                                                                    10:09:46
› {                                                                                                                                                                                  10:09:46
  id: 'release',
  name: 'docker',
  source: 'ghcr.io/getsentry/relay',
  sourceFormat: '{{{source}}}:d8e6bbc4e32d7b7d56c3ea6e5d8cecf281e1ab99',
  target: 'dav1d/relay'
}
ℹ Publishing to targets:                                                                                                                                                             10:09:46
ℹ   - docker[release]                                                                                                                                                                10:09:46
ℹ                                                                                                                                                                                    10:09:46
✔ Is everything OK? Type "yes" to proceed: … yes
ℹ                                                                                                                                                                                    10:09:48
ℹ =============================================                                                                                                                                      10:09:48
ℹ === Publishing to target: docker[release] ===                                                                                                                                      10:09:48
ℹ =============================================                                                                                                                                      10:09:48
› Spawning process: docker "login" "--username=dav1d" "--password=<lol>"                                                                              10:09:48
› docker: WARNING! Using --password via the CLI is insecure. Use --password-stdin.                                                                                                   10:09:48
› docker: WARNING! Your password will be stored unencrypted in /home/david_herberth_sentry_io/.docker/config.json.                                                                   10:09:49
› docker: Configure a credential helper to remove this warning. See                                                                                                                  10:09:49
› docker: https://docs.docker.com/engine/reference/commandline/login/#credential-stores                                                                                              10:09:49
› docker:                                                                                                                                                                            10:09:49
› docker: Login Succeeded                                                                                                                                                            10:09:49
› docker:                                                                                                                                                                            10:09:49
› docker:                                                                                                                                                                            10:09:49
› Spawning process: docker "buildx" "version"                                                                                                                                        10:09:49
› docker: github.com/docker/buildx v0.17.1 257815a                                                                                                                                   10:09:49
› docker:                                                                                                                                                                            10:09:49
› docker:                                                                                                                                                                            10:09:49
› Copying image from ghcr.io/getsentry/relay:d8e6bbc4e32d7b7d56c3ea6e5d8cecf281e1ab99 to dav1d/relay:24.9.0...                                                       [target/docker] 10:09:49
› Spawning process: docker "buildx" "imagetools" "create" "--tag" "dav1d/relay:24.9.0" "ghcr.io/getsentry/relay:d8e6bbc4e32d7b7d56c3ea6e5d8cecf281e1ab99"                            10:09:49
› docker: #1 [internal] pushing docker.io/dav1d/relay:24.9.0                                                                                                                         10:09:49
› docker: #1 0.000 copying sha256:5feec261ee5304f1ab092a1e04f3d69614e69770ae76a145a915e9d8dc205fe1 from ghcr.io/getsentry/relay:d8e6bbc4e32d7b7d56c3ea6e5d8cecf281e1ab99 to docker.io/dav1d/relay:24.9.0
› docker: #1 3.805 pushing sha256:5feec261ee5304f1ab092a1e04f3d69614e69770ae76a145a915e9d8dc205fe1 to docker.io/dav1d/relay:24.9.0                                                   10:09:53
› docker: #1 DONE 3.9s                                                                                                                                                               10:09:53
› docker:                                                                                                                                                                            10:09:53
ℹ docker:                                                                                                                                                                            10:09:53
ℹ Docker release complete                                                                                                                                            [target/docker] 10:09:53
ℹ                                                                                                                                                                                    10:09:53
ℹ Not merging per user request via no-merge option.                                                                                                                                  10:09:53
ℹ Not running the optional post-release command: 'scripts/post-release.sh' not found                                                                                                 10:09:53

And the used .craft.yml:

changelogPolicy: none
statusProvider:
  name: github
artifactProvider:
  name: none
targets:
  - id: release
    name: docker
    source: ghcr.io/getsentry/relay
    sourceFormat: "{{{source}}}:d8e6bbc4e32d7b7d56c3ea6e5d8cecf281e1ab99"
    target: dav1d/relay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Craft does not correctly push multi arch images
1 participant