Build docker rust image with alpine lunix

  alpine, docker, rust

When I build and run a Docker image, this error happens:

standard_init_linux.go:211: exec user process caused "no such file or directory"

I changed the file to use line feeds (n) with the same problem.

My Dockerfile is

FROM rustlang/rust:nightly as build

WORKDIR /usr/src/auth
COPY . .

RUN cargo install --path .

FROM alpine:latest

RUN apk update && apk add libpq

RUN apk add postgresql-dev

RUN apk add --no-cache ca-certificates tzdata 
    && rm -rf /var/cache/apk/*

COPY --from=build /usr/local/cargo/bin/auth /usr/local/bin/auth


EXPOSE 8020

CMD ["auth"]

How do I solve this issue?

Source: Docker Questions

LEAVE A COMMENT