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

Don't require $GOPATH to be set #2660

Closed
briansmith opened this issue Apr 6, 2017 · 2 comments · Fixed by #2682
Closed

Don't require $GOPATH to be set #2660

briansmith opened this issue Apr 6, 2017 · 2 comments · Fixed by #2682

Comments

@briansmith
Copy link
Contributor

When running docker-compose run boulder ./test.sh (or anything) when $GOPATH isn't set, I get this cryptic error:

ERROR: Cannot create container for service boulder: create .: volume name is too short, names should be at least two alphanumeric characters

As of Go 1.8, the default $GOPATH is $HOME/go so requiring $GOPATH to be explicitly set will be increasingly confusing to people. This was something that tripped me up when I first started working on Boulder.

@briansmith
Copy link
Contributor Author

Here's the Go 1.8 issue describing the default $GOPATH: golang/go#17262

@jsha
Copy link
Contributor

jsha commented Apr 6, 2017

Good catch, thanks. And this is something that I think has caught a number of people.

This may be tricky to implement, however. Right now we rely on these two lines in docker-compose.yml:

    volumes:
      - $GOPATH:/go/

This doesn't really support if/else statements. And I think the plan is to actually deprecate variable interpolation in future Docker versions. So we need to figure out what the best practice is for mounting a path that's usually in someone's homedir into a docker volume (with docker compose).

jsha added a commit that referenced this issue Apr 20, 2017
Removes the reliance on `$GOPATH` being set in order to use `docker-compose`. Also removes
a few unnecessary commands from the `Dockerfile` that were no longer doing anything. If you
get weird errors along the lines of `oci runtime error: cannot chdir to ...` you will need to
`docker-compose rm; docker-compose build; docker-compose up` to fix them.

Fixes #2660.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants