Skip to content

Add an option to compile code in a Docker container #7

Open
@rnag

Description

@rnag

The goal here is quite simple, but ideally we want to provide a way for users to compile rust code in a containerized manner, perhaps leveraging Docker and an Amazon Linux build image. If the host machine doesn't have rustup or cargo-zigbuild installed, we should by default use Docker to build and compile rust code.

The end goal would probably be to find a suitable Docker container, so if the container for example has zigbuild and zig already installed, that would be ideal; though of course if the architecture in the Docker container matches the target, then there's a chance we might not need zigbuild in such a case.

We could also take inspiration from other similar NPM libraries such as aws-lambda-go, which does also support building code in a Docker environment.

Docker Image

For the actual Docker image to use, I'm still open to suggestions as mentioned above, so ideally an image that comes with tools like cargo-zigbuild and cross already installed. I think an excellent starting point would be to look into the image that softprops/lambda-rust provides:

https://github.com/softprops/lambda-rust

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions