37 lines
1.4 KiB
Ruby
37 lines
1.4 KiB
Ruby
class Docker < Formula
|
|
desc "Pack, ship and run any application as a lightweight container"
|
|
homepage "https://www.docker.com/"
|
|
url "https://github.com/docker/docker-ce.git",
|
|
:tag => "v18.09.0",
|
|
:revision => "4d60db472b2bde6931072ca6467f2667c2590dff"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "fd7f17039daf874ced54a20a4d0b285cebcc35edf547a6ac62a5beb6c4c05326" => :mojave
|
|
sha256 "53d7acd92ee10128d04e95073019d1aa34bfe04aa42a204f73476ba58ff6c4ca" => :high_sierra
|
|
sha256 "215d40ac7582617b43d177452db01e6c5bfbac7442b2c721e98f788cb63b36b2" => :sierra
|
|
end
|
|
|
|
depends_on "go" => :build
|
|
|
|
def install
|
|
ENV["GOPATH"] = buildpath
|
|
dir = buildpath/"src/github.com/docker/cli"
|
|
dir.install (buildpath/"components/cli").children
|
|
cd dir do
|
|
commit = Utils.popen_read("git rev-parse --short HEAD").chomp
|
|
ldflags = ["-X github.com/docker/cli/cli.GitCommit=#{commit}",
|
|
"-X github.com/docker/cli/cli.Version=#{version}-ce"]
|
|
system "go", "build", "-o", bin/"docker", "-ldflags", ldflags.join(" "),
|
|
"github.com/docker/cli/cmd/docker"
|
|
|
|
bash_completion.install "contrib/completion/bash/docker"
|
|
fish_completion.install "contrib/completion/fish/docker.fish"
|
|
zsh_completion.install "contrib/completion/zsh/_docker"
|
|
end
|
|
end
|
|
|
|
test do
|
|
system "#{bin}/docker", "--version"
|
|
end
|
|
end
|