Hi, 

I'm trying to create Go web server into small Docker images. Here is 
my Dockerfile:


# golang:latest as build-env
FROM golang:latest AS build-env

RUN mkdir /app
ADD . /app/
WORKDIR /app
RUN cd /app && GO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o 
myapp .
# go build -o myapp


FROM scratch
COPY --from=build-env /app/myapp /app/images/* /


EXPOSE 8080
ENTRYPOINT /myapp



It uses the Docker Builder Pattern and scratch image, which is a special 
docker image that's empty. 

It builds OK, but when I run it, I'm getting:

docker: Error response from daemon: OCI runtime create failed: 
container_linux.go:344: starting container process caused "exec: 
\"/bin/sh\": stat /bin/sh: no such file or directory": unknown.

How to fix it? Thx!


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to