-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2f20ef
commit 09ac0a4
Showing
6 changed files
with
110 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
# Run this to produce the snipplet of data to insert in the Dockerfile. | ||
|
||
echo 'RUN echo \\' | ||
tar cz build | base64 | sed 's/$/\\/' | ||
echo '| base64 -d | tar xzC /' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env ruby | ||
|
||
def grpc_root() | ||
File.expand_path(File.join(File.dirname(__FILE__), '..', '..')) | ||
end | ||
|
||
def docker_for_windows_image() | ||
require 'digest' | ||
|
||
dockerfile = File.join(grpc_root, 'third_party', 'rake-compiler-dock', 'Dockerfile') | ||
dockerpath = File.dirname(dockerfile) | ||
version = Digest::SHA1.file(dockerfile).hexdigest | ||
image_name = 'grpc/rake-compiler-dock:' + version | ||
cmd = "docker build -t #{image_name} --file #{dockerfile} #{dockerpath}" | ||
puts cmd | ||
system cmd | ||
raise "Failed to build the docker image." unless $? == 0 | ||
image_name | ||
end | ||
|
||
def docker_for_windows(args) | ||
require 'rake_compiler_dock' | ||
|
||
args = 'bash -l' if args.empty? | ||
|
||
ENV['RAKE_COMPILER_DOCK_IMAGE'] = docker_for_windows_image | ||
|
||
RakeCompilerDock.sh args | ||
end | ||
|
||
if __FILE__ == $0 | ||
docker_for_windows $*.join(' ') | ||
end |