Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bazel run docker_build fails on osx #1651

Closed
pcj opened this issue Aug 15, 2016 · 1 comment
Closed

bazel run docker_build fails on osx #1651

pcj opened this issue Aug 15, 2016 · 1 comment
Labels
P2 We'll consider working on this in future. (Assignee optional) type: bug

Comments

@pcj
Copy link
Member

pcj commented Aug 15, 2016

Running a docker_build rule should install the docker image like docker load -i bazel-genfiles/.../image.tar.

Running this rule generates an executable bash script. The script template from https://github.com/bazelbuild/bazel/blob/master/tools/build_defs/docker/incremental_load.sh.tpl#L27-L28 assumes the presence of gnu sed. BSD sed (osx) does not support the -r --regexp-extended flag and the script fails.

sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
ERROR: Non-zero return code '1' from command: Process exited with status 1.

Fix could involve use awk instead, i.e. docker version -f '{{.Server.Version}}' | awk -F\. '{ print $1 }' that IIRC is more general-purpose for this task.

@philwo philwo added type: bug P2 We'll consider working on this in future. (Assignee optional) labels Aug 16, 2016
pcj added a commit to pcj/bazel that referenced this issue Sep 2, 2016
BSD sed (the default on osx) does not support the -r --regexp-extended flag.  Fixes bazelbuild#1651
@mickeyreiss
Copy link

Here's a workaround for OS X that will work for me until #1716 is released:

brew install gnu-sed
PATH=/usr/local/opt/gnu-sed/libexec/gnubin/:$PATH bazel run //application:docker # My docker_build target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) type: bug
Projects
None yet
Development

No branches or pull requests

3 participants