How to build docker-ce from source on macOS

2019-04-11 08:27发布

问题:

Anyone knows if there's a guide to build from source and replace docker binary on Mac with it?

The readme doesn't say so I try some make target but got https://github.com/docker/for-mac/issues/3353

Edited What I was trying to do, to be exact, is to debug docker cli to see why the Auth doesn't work for a single developer in my former company, regardless all factor checked and verified to be correct.

回答1:

To do this, checkout the repo of docker cli (it was confusing at first which part of docker live where). But the cli is at: git@github.com:docker/cli.git

Build it( this build dist for all platform), assuming you have make already: make -f docker.Makefile binary cross

Then either use this binary(this is for Mac), for example: build/docker-darwin-amd64 pull mysql

Or backup and replace your original /usr/local/bin/docker with the binary above.