Comments (12)
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.
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.
v0.3.2
has been released, with a docker image 🎉
from rathole.
@orhun Seems great! Can you open a PR?
from rathole.
@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.
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.
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.
🤔 Still thinking about whether or not to add this.
from rathole.
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.
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.
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.
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)
- Benchmark request
- Embedded C client / Arudino client HOT 2
- Fail to build HOT 1
- FreeBSD amd64 , ARM64
- Better Error Handling and Error Messages
- Compiling fails on FreeBSD when the websocket-rustls feature is enabled HOT 10
- Renovate the release github action
- add aarch64-apple-darwin binary release
- Potential compatibility issue of PKCS#12 format
- why is the rathole connection easily broken? HOT 6
- 不太稳定
- Binding to unix sockets
- Instant SIGKILL (a genuine stumper) HOT 7
- OpenBSD 7.4 with LibreSSL 3.8.2 doesn't compile HOT 1
- Unable to connect - Failed to deserialize hello: invalid value: integer `100466709`, expected variant index 0 <= i < 2 HOT 2
- traffic compression function, udp/tcp.
- Tunnel failure and Interruption when adding a new port HOT 1
- windows service not support HOT 6
- Can't run on Windows Server 2008 R2 HOT 2
- Connection dies after logging out from ssh HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rathole.