-
Notifications
You must be signed in to change notification settings - Fork 47
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
docker build with given Dockerfile fails. #469
Comments
Additional FYI. If I edit the Dockerfile to look like this:
Then run the container and exec a bash shell into it, and from within that running container, attempt the same
none of |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Cannot build a docker image with given Dockerfile in docker/bio-rd/Dockerfile
Steps to Reproduce
cd docker/bio-rd
docker build --tag 'rickys' .
(attempted workaround)
cp ../../go.mod .
docker build --tag 'rickys' .
(2nd attempted workaround)
cd ../.. (top dir of bio-rd)
docker build --tag 'rickys' docker/bio-rd/
Expected behavior
successfully build a docker image which contains bio-rd binary
Configuration used
charletr@hpnsw4371:/ws/charletr/bio-rd$ uname -a
Linux hpnsw4371.rose.rdlabs.hpecorp.net 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
charletr@hpnsw4371:/ws/charletr/bio-rd$ cat /etc/issue
Ubuntu 16.04.7 LTS \n \l
(FYI, I can try on a much more modern ubuntu tonight)
charletr@hpnsw4371:/ws/charletr/bio-rd$ go version
go version go1.21.5 linux/amd64
charletr@hpnsw4371:/ws/charletr/bio-rd$ docker --version
Docker version 19.03.5, build 633a0ea838
Additional context
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$ docker build --tag 'rickys' .
Sending build context to Docker daemon 2.048kB
Step 1/14 : FROM golang as builder
---> 0505a58fa464
Step 2/14 : ADD . /go/bio-rd
---> Using cache
---> 8c33e3997e5b
Step 3/14 : WORKDIR /go/bio-rd/cmd/bio-rd
---> Using cache
---> a1c5c3f03c71
Step 4/14 : RUN GOOS=linux go build -o /go/bin/bio-rd
---> Running in 0a6717ac9217
go: go.mod file not found in current directory or any parent directory; see 'go help modules'
The command '/bin/sh -c GOOS=linux go build -o /go/bin/bio-rd' returned a non-zero code: 1
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$ cp ../../go.mod .
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$ docker build --tag 'rickys' .
Sending build context to Docker daemon 4.096kB
Step 1/14 : FROM golang as builder
---> 0505a58fa464
Step 2/14 : ADD . /go/bio-rd
---> Using cache
---> 3ba4b8eb2ff0
Step 3/14 : WORKDIR /go/bio-rd/cmd/bio-rd
---> Using cache
---> 4055e5f810c9
Step 4/14 : RUN GOOS=linux go build -o /go/bin/bio-rd
---> Running in f35ac8f4b014
no Go files in /go/bio-rd/cmd/bio-rd
The command '/bin/sh -c GOOS=linux go build -o /go/bin/bio-rd' returned a non-zero code: 1
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$ cd ..
charletr@hpnsw4371:/ws/charletr/bio-rd/docker$ cd ..
charletr@hpnsw4371:/ws/charletr/bio-rd$ docker build --tag 'rickys' .
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /ws/charletr/bio-rd/Dockerfile: no such file or directory
charletr@hpnsw4371:/ws/charletr/bio-rd$ docker build --tag 'rickys' docker/bio-rd/
Sending build context to Docker daemon 4.096kB
Step 1/14 : FROM golang as builder
---> 0505a58fa464
Step 2/14 : ADD . /go/bio-rd
---> Using cache
---> 3ba4b8eb2ff0
Step 3/14 : WORKDIR /go/bio-rd/cmd/bio-rd
---> Using cache
---> 4055e5f810c9
Step 4/14 : RUN GOOS=linux go build -o /go/bin/bio-rd
---> Running in 4f20223002b8
no Go files in /go/bio-rd/cmd/bio-rd
The command '/bin/sh -c GOOS=linux go build -o /go/bin/bio-rd' returned a non-zero code: 1
charletr@hpnsw4371:/ws/charletr/bio-rd$
The text was updated successfully, but these errors were encountered: