Git Product home page Git Product logo

Comments (12)

clarkmcc avatar clarkmcc commented on May 19, 2024 4

Nowadays, I never run services by setting them up on an EC2 instance and putting nginx in front of them (that's not to say that everyone does this). Instead, I always drop the container in an orchestrator like Kubernetes, Nomad or AWS Fargate. Orchestrators like Kubernetes also handle a lot of other things such as making sure the container is alive, and they handle load balancing and routing inherently. The container abstraction provides many more benefits than just a contained deployment. Containers are great because they're lightweight, no installation is involved, they "just work" right out of the box, etc.

Just a broader observation: based on my reading of your .md files and your responses to the issues here, I can tell that you're trying to avoid scope-creep by keeping this project lightweight. I think this is a good thing, however a good open-source project strikes a balance between catering to their users needs and the projects needs. Keeping a feature such as a Dockerfile, or a TCP-replacement protocol such as QUIC (#65) out of the scope of this project only because it adds an additional file is not a good enough reason in my opinion.

Anyways, great work so far on this! I'm looking forward to seeing where it goes from here.

from rathole.

orhun avatar orhun commented on May 19, 2024 3

I think a lightweight Docker image can be built using musl + scratch e.g.

FROM ekidd/rust-musl-builder:latest as builder
WORKDIR /home/rust/src
COPY . .
RUN cargo build --profile minimal
RUN mkdir -p build-out/
RUN cp target/x86_64-unknown-linux-musl/minimal/rathole build-out/

FROM scratch
WORKDIR /app
COPY --from=builder /home/rust/src/build-out/rathole .
USER 1000:1000
ENTRYPOINT ["./rathole"]

This image is only 8.55mb on my computer when built and runs fine according to my smoke tests.

Let me know if this is needed and I'm happy to submit a PR 🙂

from rathole.

rapiz1 avatar rapiz1 commented on May 19, 2024 2

v0.3.2 has been released, with a docker image 🎉

from rathole.

rapiz1 avatar rapiz1 commented on May 19, 2024 1

@orhun Seems great! Can you open a PR?

from rathole.

orhun avatar orhun commented on May 19, 2024 1

@orhun Seems great! Can you open a PR?

Sure! Do you want 2 separate Dockerfile's for client and server? (like @xylonx did in #66)

Or you can pass the config file into container like this:

docker run -it --rm -v "$(pwd)/examples/minimal/server.toml:/app/server.toml" rathole --server /app/server.toml

docker run -it --rm -v "$(pwd)/examples/minimal/client.toml:/app/client.toml" rathole --client /app/client.toml

I think having the client/server functionality in only one image is pretty sweet 🍓

What do you think?

from rathole.

rapiz1 avatar rapiz1 commented on May 19, 2024 1

What do you think?

I think it should be put in one image :)

server and client makes little difference in size. And in this case, users probably don't care about the difference of the binary size in KiB. So I would also suggest using the release profile, instead of the minimal, which is intent to be used when every bytes matter.

from rathole.

xylonx avatar xylonx commented on May 19, 2024

It's nice to set a github workflow for building and pushing images automatically based on git tags. @rapiz1 can you set the github secrets and create a corresponding workflow?

from rathole.

rapiz1 avatar rapiz1 commented on May 19, 2024

🤔 Still thinking about whether or not to add this.

from rathole.

clarkmcc avatar clarkmcc commented on May 19, 2024

Definitely add it. Providing a Dockerfile at the very least for a service that can be deployed to the cloud (the server, not the client) is pretty standard imo.

from rathole.

rapiz1 avatar rapiz1 commented on May 19, 2024

Providing a Dockerfile at the very least for a service that can be deployed to the cloud (the server, not the client) is pretty standard imo.

Fair.

But rathole is a single binary that can be easily deployed and just run. Using docker to run it doesn't bring additional convenience, except facilitating some container management systems. Do you need the docker image for practical usage? @clarkmcc

from rathole.

rapiz1 avatar rapiz1 commented on May 19, 2024

Keeping a feature such as a Dockerfile, or a TCP-replacement protocol such as QUIC (#65) out of the scope of this project only because it adds an additional file is not a good enough reason in my opinion.

I didn't say these things were out of scope :) Actually I'm trying to figure out whether a feature request is something people really need, instead of being "fancy", and just "nice to have".

from rathole.

xylonx avatar xylonx commented on May 19, 2024

I think a lightweight Docker image can be built using musl + scratch e.g.

FROM ekidd/rust-musl-builder:latest as builder
WORKDIR /home/rust/src
COPY . .
RUN cargo build --profile minimal
RUN mkdir -p build-out/
RUN cp target/x86_64-unknown-linux-musl/minimal/rathole build-out/

FROM scratch
WORKDIR /app
COPY --from=builder /home/rust/src/build-out/rathole .
USER 1000:1000
ENTRYPOINT ["./rathole"]

This image is only 8.55mb on my computer when built and runs fine according to my smoke tests.

Let me know if this is needed and I'm happy to submit a PR 🙂

Your image is much smaller than mine. Using scratch is fantastic. I'll close my pr. Hope yours🙂

from rathole.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.