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

fix (buildx) : BuildX failing for Docker CLI on MacOS #1754

Merged

Conversation

rohanKanojia
Copy link
Member

@rohanKanojia rohanKanojia commented Feb 11, 2024

Description

Related to #1749

  • Revert workaround for checking docker version added in fix (buildx) : Always pass --config option for latest versions of Docker CLI (#1701) #1703 for checking whether to add docker --config flag or not. We need to always add config to builder whenever it involves pulling or pushing images.

  • Currently Docker CLI on Mac OS don't seem to respect --config flag. When DMP tries to override default Docker config directory by providing --config flag, Docker CLI is no longer able to recognize buildx options. This seems to happening for scenarios where docker-buildx is installed in ~/.docker/cli-plugins, whenever docker --config new/path/config is provided docker CLI uses new config path (which does not contain buildx). See Buildx not work properly on Mac with Apple Silicon chip docker/for-mac#6928 (comment)

  • Add a workaround to copy docker-buildx binary to temporary config directory created for docker buildx build. This seems to make docker recognize buildx even after config override.

Copy link

codecov bot commented Feb 11, 2024

Codecov Report

Merging #1754 (22de745) into master (21c0520) will increase coverage by 0.39%.
The diff coverage is 70.00%.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1754      +/-   ##
============================================
+ Coverage     65.33%   65.73%   +0.39%     
- Complexity     2284     2290       +6     
============================================
  Files           172      172              
  Lines         10191    10184       -7     
  Branches       1408     1405       -3     
============================================
+ Hits           6658     6694      +36     
+ Misses         2983     2936      -47     
- Partials        550      554       +4     
Files Coverage Δ
...ain/java/io/fabric8/maven/docker/util/EnvUtil.java 82.63% <ø> (ø)
...io/fabric8/maven/docker/service/BuildXService.java 74.86% <70.00%> (-2.03%) ⬇️

... and 1 file with indirect coverage changes

@rohanKanojia rohanKanojia force-pushed the pr/buildx-push-fails-mac branch 8 times, most recently from 3d893c3 to 1022e5d Compare February 11, 2024 17:35
+ Revert workaround for checking docker version for checking whether to
  add `docker --config` flag or not. We need to always add config to builder
  whenever it involves pulling or pushing images.

+ Currently Docker CLI on Mac OS don't seem to respect `--config` flag.
  When DMP tries to override default Docker config directory by providing
  `--config` flag, Docker CLI is no longer able to recognize buildx
  options. This seems to happening for scenarios where docker-buildx is installed
  in `~/.docker/cli-plugins`, whenever `docker --config new/path/config`
  is provided docker CLI uses new config path (which does not contain
  buildx).

+ Add a workaround to copy `docker-buildx` binary to temporary config
  directory created for docker buildx build. This seems to make docker
  recognize buildx even after config override.

Signed-off-by: Rohan Kumar <[email protected]>
Copy link

sonarcloud bot commented Feb 11, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
74.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@rohanKanojia rohanKanojia marked this pull request as ready for review February 11, 2024 19:16
@rohanKanojia rohanKanojia merged commit f58346e into fabric8io:master Feb 11, 2024
19 of 20 checks passed
@rohanKanojia rohanKanojia deleted the pr/buildx-push-fails-mac branch February 11, 2024 19:17
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.

1 participant