" /> " /> "/>

Automated builded images for rust-lang with rustup, "the ultimate way to install RUST"

Overview

rustup

Build Status FOSSA Status

Automated builded images on store and hub for rust-lang with musl added, using rustup "the ultimate way to install RUST".

tag changed: all3 -> all

note:

  1. Image buildings are triggered by automated builds on cloud.docker.com when "build branch" is updated by build.sh
  2. Please check liuchong/rustup tags on store instead of Build Details on hub
  3. The "build branch" and "tags" are meaningless but just docker images(which are with stable/versions tags) for building
  4. the "version tags" are available from 1.15.0
  5. the stable/beta/nightly tags does not have the package "musl-tools" and the target "x86_64-unknown-linux-musl" installed by default

Usage

Images

pull the images:

> docker pull liuchong/rustup
> docker pull liuchong/rustup:musl

the tags are:

use the image

just setup the Dockerfile:
FROM liuchong/rustup:stable
...
or you maybe prefer to make a musl static building:
# you can also use "latest", which is the same as "musl".
docker run -v $PWD:/build_dir -w /build_dir -t liuchong/rustup:musl cargo build --release
# or, you may want to use nightly channel and fix the ownership and remove container after run as below:
docker run --rm -v $PWD:/build_dir -w /build_dir -t liuchong/rustup:musl sh -c "rustup run nightly cargo build --release && chown -R $(id -u):$(id -g) target"

then, you can write a dockerfile like this and build you app image(so, the image will be very small):

FROM scratch
ADD target/x86_64-unknown-linux-musl/release/your-app /
CMD ["/your-app"]
# or something like this:
# CMD ["/your-app", "--production"]

Build script

# Use automatical checked version from website for current stable builds:
./build.sh
# Use a specified stable version from command line:
./build.sh 1.21.0
# Do not build versioning tag, just pass a string which is not fit the version pattern,
# as the first argument:
./build.sh no-version
./build.sh foo

License

MIT

FOSSA Status

Comments
  • Can't update toolchains

    Can't update toolchains

    I tried to build a docker image based on your rustup images (thank you so much for these, by the way), and wanted to update the nightly toolchain to the one that's currently out, using this naive method:

    rustup update nightly
    

    Sadly, this runs into the following problem in docker:

    unable to update due to layerfs
    Step 3/4 : RUN rustup update nightly
    
     ---> Running in 8b72657bbc0c
    
    info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
    
    info: latest update on 2017-09-16, rust version 1.22.0-nightly (fd4bef54a 2017-09-15)
    
    info: downloading component 'rustc'
    
    info: downloading component 'rust-std'
    
    info: downloading component 'cargo'
    
    info: downloading component 'rust-docs'
    
    info: removing component 'rustc'
    
    info: removing component 'rust-std'
    
    info: removing component 'cargo'
    
    info: removing component 'rust-docs'
    
    info: rolling back changes
    
    error: could not rename component directory from '/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/share/doc/rust/html' to '/root/.rustup/tmp/omziwl1d4tvp_f9p_dir/bk'
    info: caused by: Invalid cross-device link (os error 18)
    
    Removing intermediate container 8b72657bbc0c
    
    The command '/bin/sh -c rustup update nightly' returned a non-zero code: 1
    

    (You can also see the build output on docker hub here: https://hub.docker.com/r/antifuchs/rustup-ci/builds/bh6g3fkmuykk32sav82vqlu/)

    I wonder if there's something that these docker images could work around, so I'm reporting this here; it might just be unsolvable & I might have to remove the nightly toolchain and tmp dir before attempting the update.

    Anyway, if you know of a solution that might work, I'd love to hear about it!

    enhancement question 
    opened by antifuchs 2
  • Upgrade to newer version of binutils for nightly + musl

    Upgrade to newer version of binutils for nightly + musl

    As mentioned in rust-lang/rust#34978, the Rust-provided MUSL components are now being built with a newer version of binutils, one that is incompatible with the version provided in the current container. The current solution is to upgrade binutils in some fashion. For Ubuntu-based containers, upgrading to 16.04 contains the fixes. I'm not sure what version of Debian will include them.

    An example of output where the versions mismatch.

    Thanks for all your hard work!

    opened by shepmaster 2
  • MUSL libraries are only installed for the default toolchain, not others (like nightly)

    MUSL libraries are only installed for the default toolchain, not others (like nightly)

    For example:

    docker run -it --rm -v my-code:/code --workdir /code liuchong/rustup:musl \
      rustup run nightly cargo build --target=x86_64-unknown-linux-musl --release
    

    As a workaround, I am doing

    rustup default nightly
    rustup target add x86_64-unknown-linux-musl
    cargo build --target=x86_64-unknown-linux-musl --release
    
    opened by shepmaster 2
  • Add license scan report and status

    Add license scan report and status

    Your FOSSA integration was successful! Attached in this PR is a badge and license report to track scan status in your README.

    Below are docs for integrating FOSSA license checks into your CI:

    opened by fossabot 1
  • [Non-Repo Related] Rust Crate

    [Non-Repo Related] Rust Crate

    Hello @liuchong :) I am sorry for posting this here, but I did not know where to contact you otherwise. I am about to write a crate that I want to publish under the name "data". You are the current owner on https://crates.io for a crate with this name; but there is no activity for almost four years now.

    I was wondering whether you are willing to provide ownership over the crate (name) to me, because currently, the crate is just unmaintained, the corresponding repository does not seem to exist anymore and I'd like to provide a crate with this name :) Is that possible?

    opened by georglauterbach 0
Owner
刘冲
学而时习之,不亦悦乎?
刘冲
Docker images for compiling static Rust binaries using musl-libc and musl-gcc, with static versions of useful C libraries. Supports openssl and diesel crates.

rust-musl-builder: Docker container for easily building static Rust binaries Source on GitHub Changelog UPDATED: Major updates in this release which m

Eric Kidd 1.3k Jan 1, 2023
Docker images for compiling static Rust binaries using musl-cross

rust-musl-cross Docker images for compiling static Rust binaries using musl-cross-make, inspired by rust-musl-builder Prebuilt images Currently we hav

messense 365 Dec 30, 2022
Inspect and dump OCI images.

reinlinsen ?? rl is a tool to inspect and dump OCI images or single image layers. Installation From source If you have cargo installed you can just ru

Tobias Brumhard 5 May 11, 2023
docker-rust — the official Rust Docker image

About this Repo This is the Git repo of the Docker official image for rust. See the Docker Hub page for the full readme on how to use this Docker imag

The Rust Programming Language 321 Dec 11, 2022
Very small rust docker image

mini-docker-rust Very small rust docker image. This is an example project on how to build very small docker images for a rust project. The resulting i

null 155 Jan 1, 2023
A wasm template for Rust to publish to gh-pages without npm-deploy

Wasm template for Rust hosting without npm-deploy on github pages using Travis script It automatically hosts you wasm projects on gh-pages using a tra

Siddharth Naithani 102 Dec 24, 2022
App Engine Rust boilerplate

Rust App Engine This projects is a minimal boilerplate ro run Rust web application inside Google App Engine. To deploy it use Google Cloud Shell: ```s

Denis Kolodin 48 Apr 26, 2022
A tiny minimal container runtime written in Rust.

vas-quod A tiny minimal container runtime written in Rust. The idea is to support a minimal isolated containers without using existing runtimes, vas-q

flouthoc 438 Dec 26, 2022
oci-image and oci-runtime spec in rust.

oci-lib Oci-Spec for your container runtime or container registry. Oci-lib is a rust port for original oci spec written in go. Following crate contain

flouthoc 12 Mar 10, 2022
Experimental implementation of the oci-runtime in Rust

youki Experimental implementation of the oci-runtime in Rust Overview youki is an implementation of runtime-spec in Rust, referring to runc. This proj

utam0k 12 Sep 23, 2022
Krustlet: Kubernetes Kubelet in Rust for running WASM

Krustlet: Kubernetes Kubelet in Rust for running WASM ?? ?? This project is highly experimental. ?? ?? It should not be used in production workloads.

null 103 Dec 29, 2022
youki is an implementation of the OCI runtime-spec in Rust, similar to runc.

youki is an implementation of the OCI runtime-spec in Rust, similar to runc.

Containers 4.2k Dec 29, 2022
Shallow Container is a light-weight container tool written in Rust.

Shallow Container is a light-weight container tool written in Rust. It is totally for proof-of-concept and may not suit for production environment.

Rui Li 14 Apr 8, 2022
Easy to use, extendable, OCI-compliant container runtime written in pure Rust

PURA - Lightweight & OCI-compliant container runtime Pura is an experimental Linux container runtime written in pure and dependency-minimal Rust. The

Branimir Malesevic 73 Jan 9, 2023
Container monitor in Rust

Conmon-rs A pod level OCI container runtime monitor. The goal of this project is to provide a container monitor in Rust. The scope of conmon-rs encomp

Containers 84 Dec 21, 2022
Rust Kubernetes client and controller runtime

kube-rs Rust client for Kubernetes in the style of a more generic client-go, a runtime abstraction inspired by controller-runtime, and a derive macro

kube-rs 1.8k Jan 8, 2023
A simple containerized application manage system like Kubernetes, but written in Rust

rMiniK8s A simple dockerized application management system like Kubernetes, written in Rust, plus a simple FaaS implementation. Course Project for SJT

markcty 15 Jul 8, 2023
Rust client for the huggingface hub aiming for minimal subset of features over `huggingface-hub` python package

This crates aims to emulate and be compatible with the huggingface_hub python package. compatible means the Api should reuse the same files skipping d

Hugging Face 9 Jul 20, 2023
Rust library for whisper.cpp compatible Mel spectrograms

Mel Spec A Rust implementation of mel spectrograms aligned to the results from the whisper.cpp, pytorch and librosa reference implementations and suit

Wavey.ai 5 Aug 28, 2023