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

Adds $GOPATH/bin to PATH and reduces an extra layer from image #170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

navidshaikh
Copy link

Merges yum -y update layer with yum install golang layer.
Creates $GOPATH/src and $GOPATH/bin directories.
Appends $GOPATH/bin to $PATH env variable.
Uses $GOPATH as workdir instead of hard cording /go.

  Merges `yum -y update` layer with `yum install golang` layer.
  Creates $GOPATH/src and $GOPATH/bin directories.
  Appends $GOPATH/bin to $PATH env variable.
  Uses $GOPATH as workdir instead of hard cording `/go`
Copy link
Contributor

@mohammedzee1000 mohammedzee1000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@navidshaikh
Copy link
Author

navidshaikh commented Mar 1, 2018

Additional information on the built image (manual build).
Layers - 2

✗ docker inspect -f {{.RootFS.Layers}} centos7-golang                      
[sha256:e15afa4858b655f8a5da4c4a41e05b908229f6fab8543434db79207478511ff7 sha256:201701adb1122ff293cd4905dee9b4afcecd94bfc7ac1fef3e45fd07f804180f]

✗ docker run -ti centos7-golang
[root@9d427735caff go]# rpm -q golang
golang-1.8.3-1.el7.x86_64

[root@9d427735caff go]# echo $GOPATH
/go

[root@9d427735caff go]# echo $PATH  
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/go/bin

[root@9d427735caff go]# ll /go/
total 8
drwxrwxrwx. 2 root root 4096 Mar  1 08:46 bin
drwxrwxrwx. 2 root root 4096 Mar  1 08:46 src

@navidshaikh
Copy link
Author

Removed installation of git RPM.
The centos golang image should have pure centos and golang stack, needed additional dependencies to be installed explicitly via application layers.

ping @mohammedzee1000

@dharmit
Copy link
Contributor

dharmit commented Mar 1, 2018

golang package doesn't pull git as a dependency.

@navidshaikh
Copy link
Author

golang package doesn't pull git as a dependency.

Thanks! git is needed in golang image for go get utility and golang package needs to add git as dependencies.

Updated the PR, reverted removing the installation of git RPM.

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

Successfully merging this pull request may close these issues.

3 participants