Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

cannot find package "github.com/docker/docker/pkg/units" #28

Closed
scottwalters opened this issue Aug 27, 2015 · 4 comments
Closed

cannot find package "github.com/docker/docker/pkg/units" #28

scottwalters opened this issue Aug 27, 2015 · 4 comments

Comments

@scottwalters
Copy link

Could you please add some instructions to the README.md for people who don't know golang?

I tried to Google this and found these instructions for installing Go packages: http://stackoverflow.com/questions/10772799/how-to-install-golang-3rd-party-projects-from-download-sources

That seems strange and overly complicated but if it's right I'll give it a whirl.

It seems like "units" is the Go package I need to build this, but Googling "golang package units", I can't find anything plausible in the first two pages.

Building docker-squash
export.go:19:2: cannot find package "github.com/docker/docker/pkg/units" in any of:
        /usr/lib/go/src/pkg/github.com/docker/docker/pkg/units (from $GOROOT)
        /root/t/docker-squash/src/github.com/docker/docker/p

tl;dr would be nice if what I needed to know about Go to build this was included in the README.md since the solution doesn't seem to be immediately searchable =)

Thanks

@jwilder
Copy link
Owner

jwilder commented Aug 27, 2015

@scrottie There are some instructions here: https://github.com/jwilder/docker-squash#development

glock is used to manage manage dependencies. Some of the packages this project depends on have moved around so glock makes sure they are at the correct version. Updating your dependencies w/ glock should allow you to build.

@scottwalters
Copy link
Author

Ah, thanks for the clarification. I saw that but misunderstood glock to be a tool for people contributing to docker-squash.

From glock's docs:

# Fetch and install glock
$ go get github.com/robfig/glock

...

root@localhost:~# go get github.com/robfig/glock
package github.com/robfig/glock: cannot download, $GOPATH not set. For more details see: go help gopath

This seems to get back to the Go package installation instructions in the stackoverflow article. I'll have to play with that later and maybe harass that project maintainer.

Thanks again.

@jwilder
Copy link
Owner

jwilder commented Aug 27, 2015

@scrottie You're go env is not setup yet. You need to set a GOPATH env variable so the go tools know where to find and install package locally.

mkdir -p $HOME/go
export GOPATH=$HOME/go

Once that is setup, you would clone this repo to $GOPATH/src/github.com/jwilder/docker-squash and then run glock and make from there.

You'll want to add GOPATH=$HOME/go to you .bashrc or other env setup files.

@macmladen
Copy link

macmladen commented Aug 14, 2016

Frankly, I agree with @scrottie, osx_install.mdcould be a bit more clear for those not fluent with Go.

In your last comment you state mkdir -p $HOME/go while in document it is with dot, mkdir -p $HOME/.go so that can also bring some confusion in.

It is probably true that once Go is configured it does not matter where source goes and where it is build, however, on golang.org site they say

We'll use github.com/user as our base path. Create a directory inside your workspace 
in which to keep source code:

$ mkdir -p $GOPATH/src/github.com/user

And that is a good idea to keep everything Go there.

So I would suggest you to add all these steps and note to change directory in explanation so source gets to right place. Please add the part about glock from Development section also to osx_install.md so that people knows they should install and issue glock sync github.com/jwilder/docker-squash to prepare for make.

I can do it in pull request if you wish?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants