denoland / deno_docker

Latest dockerfiles and images for Deno - alpine, centos, debian, ubuntu
https://hub.docker.com/r/denoland/deno
MIT License
883 stars 101 forks source link

Simple express app segfaults in alpine Docker image #319

Open serenitus opened 10 months ago

serenitus commented 10 months ago

I have a very simple express app that runs perfectly well locally (Intel Mac, Sonoma) but segfaults when run using the latest official alpine Docker image.

Dockerfile:

FROM denoland/deno:alpine-1.38.0

EXPOSE 8080

WORKDIR /app

RUN apk add --no-cache bash coreutils grep sed

USER deno

ADD . .

CMD ["run", "--allow-all", "main.ts"]
# CMD ["--version"]

main.ts:

import express from 'npm:express@4.18.2';

const app = express();

Running with: docker run -d --init -it -p 8080:8080 app

deno itself runs just fine as can be seen by trying the --version command currently commented out in the Docker file or, in fact, trying any other trivial code such as console.log().

Can anyone figure out what the issue is?

serenitus commented 10 months ago

I have managed to make this work with alpine-1.34.0 but haven't narrowed the issue down any further than that as yet.

Update: it broke with alpine-1.37.2

serenitus commented 10 months ago

Actually, that turned out to be a bit misleading. While 1.37.2 dies immediately, 1.37.1 and 1.37.0 die after a second or too. I was misled by their fleeting presence in the docker ps list.

alpine-1.36.4 actually seems to be the last stable release.