Rocket: How to deploy?

Created on 24 Jan 2018  路  11Comments  路  Source: SergioBenitez/Rocket

Hi There

I can't find any information on deployment, only development.

My goal is to get a static binary as the result of this tutorial https://rocket.rs/guide/overview/#launching

I then want to copy the static binary onto a Linux machine and run it.

Is this possible? If yes, how to do it?

thanks

docs question

All 11 comments

@bootrino I simply wrap it in a docker container or just build the binary and then create a systemd file for it. You can either build the binary on a linux box with the same libc or use xargo to cross build.

Basically the documentation is lacking because it is the same for all Rust binaries and very similar for C/C++ binaries. Don't know about you but I am more used to high level langs so was a little foreign to me.

@corbinu so are you saying that the outcome of the tutorial process above is a statically linked binary? If yes, then where is it located after the build, what is it named, and how would I run it if I moved it to another machine?

I want to run the tutorial on Ubuntu then move the resulting executable to an Alpine machine and run it there but I dodn't know what files to pick up to do that or how to do that.

thanks

@bootrino Yes it will result in a binary however the Ubuntu version will be glibc so it will not run on Alpine which has a libc of musl

Thanks @Corbinu - can I re-ask my questions please on the assumption that I can address the glibc thing somehow?

@bootrino The binary ends up in target/release if you run cargo build --release. This is not rocket specific all the details are in the cargo docs

All the cargo info is here: https://doc.rust-lang.org/cargo/ The result is just a binary like any other.

Great thanks. Sorry I don't know much about Rust, just trying to build a demo.

No need to be sorry we all have been there!

Check out my YoukeBox repository

My build configuration is in my Makefile, the build steps are in my Jenkinsfile.
I start with just source code & end with an installable rpm file.

I'd love to have documentation on deploying! It's definitely a missing section of the guide. We're tracking that over on https://github.com/SergioBenitez/Rocket/issues/171. If you've been able to figure out your particular deploying issues @bootrino, please feel free to close this issue out.

Tracking this in #171.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ndarilek picture ndarilek  路  3Comments

PSeitz picture PSeitz  路  3Comments

Qqwy picture Qqwy  路  3Comments

lambda-fairy picture lambda-fairy  路  4Comments

sphinxc0re picture sphinxc0re  路  3Comments