Skip to content

Commit 01398e1

Browse files
committed
Convert Linux Docker build script to Ruby. This allows us to build the Linux image across platforms.
1 parent 290ecda commit 01398e1

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

build-linux-docker.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!env ruby
2+
3+
match = File.read('main.go').match(/Version.*(\d+\.\d+\.\d+)/)
4+
version = match[1]
5+
if !version
6+
puts 'Version not found.'
7+
exit 1
8+
end
9+
10+
target = "runx-linux-x64-#{version}"
11+
system('docker build -t runx .')
12+
system('docker run -it runx')
13+
id = `docker ps -l -q`.strip
14+
system("docker cp #{id}:/src/runx ./#{target}")
15+
system("docker rm #{id}")
16+
system("docker run -it --rm -v #{Dir.pwd}/#{target}:/bin/runx golang:1-wheezy bash")
17+
system("docker rmi runx:latest")

build-linux-docker.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)