Luna JaxL
Deno3y ago
Luna Jax

Deno Compile in NixOS docker image

I'm trying to compile code to deploy to aws lambda functions. I can do it locally on my m1 mac just fine, but I'm trying to do it inside of a docker container (github action) that's running NixOS.

I should note that it builds just fine in docker container if I don't include the target argument, but then the compiled code won't run on aws lambda.

deno compile main.ts --allow-all --no-check --target x86_64-unknown-linux-gnu --output /bf/dist/backend/bootstrap
Archive:  /tmp/.tmpPo9BKa/deno.zip
  inflating: deno                    Archive:  /tmp/.tmph4f33i/deno.zip
Compile file:///bf/packages/backend/main.ts to /bf/dist/backend/bootstrap
  inflating: deno                    Archive:  /tmp/.tmpJoJywc/deno.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /tmp/.tmpJoJywc/deno.zip or
        /tmp/.tmpJoJywc/deno.zip.zip, and cannot find /tmp/.tmpJoJywc/deno.zip.ZIP, period.

============================================================
Deno has panicked....

Platform: linux x86_64
Version: 1.35.2
Args: ["deno", "compile", "main.ts", "--allow-all", "--no-check", "--target", "x86_64-unknown-linux-gnu", "--output", "/bf/dist/backend/bootstrap"]

thread 'main' panicked at 'assertion failed: unpack_status.success()', cli/tools/upgrade.rs:555:3
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
make: *** [Makefile:10: backend] Error 1
error: Uncaught Error: Failed to build backend
    throw new Error("Failed to build backend");
          ^
    at build (file:///bf/cdk/backend.ts:67:11)
    at eventLoopTick (ext:core/01_core.js:183:11)
    at async file:///bf/cdk/backend.ts:75:1

Subprocess exited with error 1
Error: Process completed with exit code 1.
Was this page helpful?