Комментарии:
How did you run the go file in Alpine without golang?
ОтветитьDirect to the point. Thanks.
Ответить=> ERROR [builder 4/4] RUN go build -o webserver .
> [builder 4/4] RUN go build -o webserver .:
#0 0.649 go: go.mod file not found in current directory or any parent directory; see 'go help modules'
------
ERROR: failed to solve: executor failed running [/bin/sh -c go build -o webserver .]: ex
why iam error? can help me to explain this?
Great video! Thanks!
ОтветитьThank you for this video! :)
ОтветитьThanks really clear
ОтветитьThanks a lot
Ответитьsimple and to the point, thank you :)
ОтветитьThis is awesome, thank you.
ОтветитьError: error preparing container a005d60bbe11f0d23810156 for attach: crun: executable file `./webserver` not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found
Tried the same and received when try to do podman run
fantastic video. thanks for posting
Ответитьwhat about the memory footprints if you are utilizing the lower layers somewhere else as well? are we saving by this way also some?
ОтветитьBut anyway why is he building the application inside the docker container ? What about doing the building outside and push the final build artifacts into a tiny base image?
ОтветитьThanks for the video. I have Django, Apache, React. How do I do this. It's little unclear about the video. First image has go lang libraries. Second one you are starting with alpine and where are go lang libraries. you are copying your app file only.
ОтветитьThanks for the video. However it doesn't work anymore.
$ cat Dockerfile-2.df
FROM golang:latest AS builder
WORKDIR /go/src/app
COPY main.go .
RUN go build -o webserver .
FROM alpine
WORKDIR /app
COPY --from=builder /go/src/app/ /app/
CMD ["./webserver"]
$ docker build -t webserver -f Dockerfile-2.df .
Sending build context to Docker daemon 4.096kB
Step 1/8 : FROM golang:latest AS builder
---> ee23292e2826
Step 2/8 : WORKDIR /go/src/app
---> Using cache
---> 57fe449c0365
Step 3/8 : COPY main.go .
---> Using cache
---> ac48e92ef385
Step 4/8 : RUN go build -o webserver .
---> Running in baa4d55b7073
go: go.mod file not found in current directory or any parent directory; see 'go help modules'
The command '/bin/sh -c go build -o webserver .' returned a non-zero code: 1
I have to try it tomorrow with my nodejs app)
ОтветитьThanks for creating this video.
ОтветитьGood Vid! in production you should use distroless images though. In staging for debugging a normal distro image is completely fine though !
ОтветитьDude you are a God! Was racking my brain on how to reduce my image size because they were in Giga size! This video is gold!
Ответить