Skip to content

Using docker buildx bake to build a binary at a tagged commit ends up with a X.Y.Z.m version #3347

Description

@ericpromislow

Description

When I build a CLI with the command docker builds bake --set binary.platform=X/amd64 (where X is darwin, linux, or windows) at the tag v20.10.9, running build/docker -v says 20.10.9.m. The .m is problematic.

Steps to reproduce the issue:

On a macos box, do the following:

cd /tmp
git clone -b v20.10.9 https://github.com/docker/cli.git
cd cli
docker buildx bake --set binary.platform=darwin/amd64
./build/docker -v

Describe the results you received:

20.1.9.m

Describe the results you expected:

20.1.9

Additional information you deem important (e.g. issue happens only occasionally):

I added git status near the top of scripts/build/.variables and got this output, which explains the problem:

#18 1.828 + git status
#18 2.068 HEAD detached at v20.10.9
#18 2.068 Changes not staged for commit:
#18 2.068 (use "git add/rm <file>..." to update what will be committed)
#18 2.068 (use "git restore <file>..." to discard changes in working directory)
#18 2.068 deleted: .circleci/config.yml
#18 2.068 deleted: .dockerignore
#18 2.068 deleted: .github/CODEOWNERS
#18 2.068 deleted: .github/ISSUE_TEMPLATE.md
#18 2.068 deleted: .github/PULL_REQUEST_TEMPLATE.md
#18 2.068 deleted: .github/workflows/codeql-analysis.yml
#18 2.068 deleted: .gitignore
#18 2.068 deleted: appveyor.yml
#18 2.068 deleted: cli/winresources/res_windows.go
#18 2.068 modified: scripts/build/.variables
#18 2.068
#18 2.068 no changes added to commit (use "git add" and/or "git commit -a")

Output of docker version:

Client:
Cloud integration: 1.0.17
Version: 20.10.8
API version: 1.41
Go version: go1.16.6
Git commit: 3967b7d
Built: Fri Jul 30 19:55:20 2021
OS/Arch: darwin/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.8
API version: 1.41 (minimum version 1.12)
Go version: go1.16.6
Git commit: 75249d8
Built: Fri Jul 30 19:52:10 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.9
GitCommit: e25210fe30a0a703442421b0f60afac609f950a3
runc:
Version: 1.0.1
GitCommit: v1.0.1-0-g4144b63
docker-init:
Version: 0.19.0
GitCommit: de40ad0

Output of docker info:

Client:
Context: default
Debug Mode: false
Plugins:
buildx: Build with BuildKit (Docker Inc., v0.6.1-docker)
compose: Docker Compose (Docker Inc., v2.0.0-rc.1)
scan: Docker Scan (Docker Inc., v0.8.0)
Server:
Containers: 30
Running: 21
Paused: 0
Stopped: 9
Images: 18
Server Version: 20.10.8
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version: e25210fe30a0a703442421b0f60afac609f950a3
runc version: v1.0.1-0-g4144b63
init version: de40ad0
Security Options:
seccomp
Profile: default
Kernel Version: 5.10.47-linuxkit
Operating System: Docker Desktop
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 1.938GiB
Name: docker-desktop
ID: 73GC:37KA:5L75:IYDE:3WL2:LVCJ:L46N:77NZ:GN2W:CV76:NJSS:EPUW
Docker Root Dir: /var/lib/docker
Debug Mode: false
HTTP Proxy: http.docker.internal:3128
HTTPS Proxy: http.docker.internal:3128
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

This happens on a github action as well, on ubuntu. I don't know the version of docker they're running.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions