Running Mojo executable at Alpine docker

I created a mojo dockerfile the is working fine:
FROM ubuntu:latest
FROM ubuntu:latest
And wanted to use it as a builder image:
#Builder
FROM mojo-sdk:latest as builder
WORKDIR /app
COPY main.mojo /app/main.mojo
RUN /root/.modular/pkg/packages.modular.com_mojo/bin/mojo build /app/main.mojo

#Final
FROM alpine:latest
WORKDIR /app
COPY --from=builder /app/main /app/main
RUN chmod +x /app/main
ENTRYPOINT ["tail"]
CMD ["-f", "/dev/null"]
#Builder
FROM mojo-sdk:latest as builder
WORKDIR /app
COPY main.mojo /app/main.mojo
RUN /root/.modular/pkg/packages.modular.com_mojo/bin/mojo build /app/main.mojo

#Final
FROM alpine:latest
WORKDIR /app
COPY --from=builder /app/main /app/main
RUN chmod +x /app/main
ENTRYPOINT ["tail"]
CMD ["-f", "/dev/null"]
But I could not run the executable at the alpine based docker, and got the error:
/app # ls
main
/app # ./main
sh: ./main: not found
/app # ls -l
total 1040
-rwxr-xr-x 1 root root 1061752 Dec 23 18:27 main
/app # ls
main
/app # ./main
sh: ./main: not found
/app # ls -l
total 1040
-rwxr-xr-x 1 root root 1061752 Dec 23 18:27 main
I guess there are some dependencies that are exisiting at ubuntu and not exisiting at the Alpine docker, that is making the executable not be seen, noting that I just built the simpletst "heelo world" example.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server