Comments (6)
For what it is worth, I have now reproduced this same error using ubuntu:latest
as the base image.
The Dockerfile contents:
FROM ubuntu:latest
RUN apt-get update \
&& apt-get install -y \
curl gcc git libc6-dev make \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
ENV GOLANG_VERSION 1.4.2
ENV PATH /go/bin:/usr/src/go/bin:$PATH
ENV GOPATH /go
RUN curl --insecure -sSL https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz \
| tar -v -C /usr/src -xz
RUN cd /usr/src/go/src && ./make.bash --no-clean 2>&1
RUN mkdir -p /go/src/app /go/bin && chmod -R 777 /go
WORKDIR /go
ENV GIT_SSL_NO_VERIFY true
RUN go get github.com/constabulary/gb/...
COPY . /go
RUN gb build all
The error message is identical:
2015/05/01 15:13:20 INFO compile github.com/jbuberel/prime_finder/app [server.go]
2015/05/01 15:13:20 command "build" failed: run: [/usr/lib/google-golang/pkg/tool/linux_amd64/6g -p github.com/constabulary/gb/cmd/gb -pack -o /tmp/gb261408936/github.com/constabulary/gb/cmd/gb/main.a -I /tmp/gb261408936 -I /go/pkg/linux/amd64 -complete build.go main.go plugin.go test.go]: [/usr/lib/google-golang/pkg/tool/linux_amd64/6g -p github.com/constabulary/gb/cmd/gb -pack -o /tmp/gb261408936/github.com/constabulary/gb/cmd/gb/main.a -I /tmp/gb261408936 -I /go/pkg/linux/amd64 -complete build.go main.go plugin.go test.go]: fork/exec /usr/lib/google-golang/pkg/tool/linux_amd64/6g: no such file or directory
2015/05/01 15:13:20 INFO build duration: 10.005319ms map[compile:4.017273ms]
from gb.
Possibly related to: moby/moby#8539
from gb.
Interesting - setting the GOBIN environment variable inside the Docker image seems to have resolved the problem. I am going to next verify this against the google/golang docker base image.
FROM ubuntu:latest
RUN apt-get update \
&& apt-get install -y \
curl gcc git libc6-dev make \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
ENV GOLANG_VERSION 1.4.2
ENV PATH /go/bin:/usr/src/go/bin:$PATH
ENV GOPATH /go
RUN mkdir -p /gosrc
RUN curl --insecure -sSL https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz \
| tar -v -C /gosrc -xz
RUN cd /gosrc/go/src && ./make.bash --no-clean 2>&1
RUN mkdir -p /go/ /go/bin && chmod -R 777 /go
ENV GOBIN /gosrc/go/bin
ENV PATH /gosrc/go/bin:$PATH
WORKDIR /go
ENV GIT_SSL_NO_VERIFY true
RUN go get github.com/constabulary/gb/...
COPY . /go
RUN gb build all
from gb.
Confirmed, the problem seems to be solvable by specifically setting the GOBIN
environment variable to ensure it points to the same location where the go command was installed into.
Is this worth mentioning in the docs?
from gb.
from gb.
After grabbing the latest gb
snapshot, the problem is now resolved by using the -goroot as you suggested.
The final, working, Dockerfile is this:
FROM gcr.io/google_appengine/base
RUN apt-get update \
&& apt-get install -y \
curl gcc git libc6-dev make \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
ENV GOLANG_VERSION 1.4.2
ENV PATH /go/bin:/gosrc/go/bin:$PATH
ENV GOPATH /go
RUN mkdir -p /gosrc
RUN curl -sSL https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz \
| tar -v -C /gosrc -xz
RUN cd /gosrc/go/src && ./make.bash --no-clean 2>&1
RUN mkdir -p /go/ /go/bin && chmod -R 777 /go
WORKDIR /go
COPY . /go
RUN rm -rf src/github.com/constabulary/
RUN rm -rf vendor/src/github.com/constabulary/
RUN go get github.com/constabulary/gb/...
RUN ["/go/bin/gb", "build", "-goroot=/gosrc/go", "all" ]
ENTRYPOINT ["/go/bin/app"]
from gb.
Related Issues (20)
- gb should fail early with unknown/unsupported GOOS or GOARCH value
- Error vendoring gb with gb-vendor HOT 2
- gb build does not create bin folder and binary in bin folder HOT 24
- Website needs list of projects using GB
- Gogland (perhaps also others) configuration example HOT 1
- why vendor/src? HOT 1
- gb build fails on centos7 with linking error HOT 6
- have any command copy a package from $GOPATH
- Can't build project in Docker HOT 2
- gb build do not work correctly on windows (can work correctly on linux)
- Build of Go's runtime package fails when cross-compiling with go1.9.4 HOT 6
- horizon HOT 4
- using gb to make a library HOT 2
- Is the gb project dead? HOT 15
- / HOT 1
- gb vendor doesn't work with fish shell HOT 1
- [SOLVED] How to migrate to go modules? HOT 6
- gb + IDE ? HOT 1
- Cross build not working on OSX: cgo_export_static main only allowed in cgo-generated code
- module github.com/constabulary/gb@latest found (v0.4.4), but does not contain package github.com/constabulary/gb/internal/vendor HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gb.