Skip to content

Conversation

@benyanke
Copy link

Allows folks who have not gotten a local rust tool-chain installed but have docker to do a containerized compile.

@0n1cOn3
Copy link

0n1cOn3 commented Aug 22, 2024

Wouldn't be something like that easier with a Dockerfile ?

# Use the official Rust image as the base image
FROM rust:latest

# Set the working directory inside the container
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . .

# Update the package list and install de pendencies
RUN apt-get update && \
    apt-get install -y libfuse3-dev

# Build the Rust project
RUN cargo build

# The final command to run the compiled binary
CMD ["./target/debug/when-fs"]

@benyanke
Copy link
Author

Perhaps, though that has a slightly different purpose and use.

The Dockerfile solution is to provide the ability to run it in a container, presumably through mounting the fuse socket.

My solution allows you to build within a container (without needing a working rust build chain setup) but then run the binary on the host directly.

Both have value though they serve different purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants