Skip to content

A project template for a small Docker image (11.4 MB) containing a service based on the Rust programming language and the Tokio platform.

Notifications You must be signed in to change notification settings

chrlen/Tokio-Docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository provides a template for a service utilizing the Rust programming language and the Tokio platform. The templates includes a Dockerfile for building a small (11.4MB) Docker image based on Alpine Linux and a docker-compose file to deploy the container while adding a route to Traefik.

Setup

Install the Rustup toolchain manager according to the instructions for your platform. Then run the following commands to install a nightly Rust toolchain and build a release binary.

rustup install nightly
cargo +nightly build --release

To compile against musl for deployment on Alpine Linux add a target as follows.

rustup target add x86_64-unknown-linux-musl

Docker

Run the following line to build an image from the Dockerfile.

docker build .

Consider fixing the versions of the rust and alpine containers in the Dockerfile instead of using the "latest" tag.

NixOS

If you are on NixOS you can use the provided shell.nix.

nix-shell

About

A project template for a small Docker image (11.4 MB) containing a service based on the Rust programming language and the Tokio platform.

Topics

Resources

Stars

Watchers

Forks