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

Unbound variable causes docker_build.sh to fail on macOS. #48

Closed
au42 opened this issue Jun 21, 2019 · 2 comments
Closed

Unbound variable causes docker_build.sh to fail on macOS. #48

au42 opened this issue Jun 21, 2019 · 2 comments

Comments

@au42
Copy link

au42 commented Jun 21, 2019

Development Environment

  • macOS 10.14.5
  • Docker version 18.09.2, build 6247962
  • docker-compose version 1.23.2, build 1110ad01
  • repo version v1.13.3
  • repo launcher version 1.25
  • git version 2.22.0
  • Python 2.7.16

Goal
Build the Wirepas Gateway for Linux (wm-gateway) docker image natively on macOS using instructions on README.md in a fresh repo download.

Steps to Reproduce
$ repo init -u https://github.com/wirepas/manifest.git
$ repo sync
$ ./container/docker-build.sh --build-defaults container/build_defaults.env

Output

+ set -e
+ set -o nounset
+ set -o errexit
+ set -o errtrace
++ basename ./container/docker-build.sh
+ _ME=docker-build.sh
+ _main --build-defaults container/build_defaults.env
+ _parse_build_default_path --build-defaults container/build_defaults.env
+ [[ 2 -gt 0 ]]
+ key=--build-defaults
+ case "${key}" in
+ PATH_PROJECT_DEFAULTS_PATH=container/build_defaults.env
+ shift
+ shift
+ [[ 0 -gt 0 ]]
./container/docker-build.sh: line 111: POSITIONAL[@]: unbound variable
@au42
Copy link
Author

au42 commented Jun 21, 2019

Modifying the file container/docker-build.sh at line 111 to include a default value parameter fixes this issue on macOS builds:

set -- "${POSITIONAL[@]-default}" 

@PFigs
Copy link
Contributor

PFigs commented Jul 8, 2019

Hi,

Thanks for raising the issue. Your fix will work.

Currently, we are working to drop our custom docker-build.sh script and move to a composition file to make it easier to read and understand by everyone.

The first change is coming in #42 where the development builds are the main target.

This change will also make our builds rely completely on the repo tool and our manifests.

We target to complete the overhaul over the upcoming two weeks.

@PFigs PFigs closed this as completed Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants