/learning-rust

Getting Rusty with rust tutorials. Following the documentation called " Rust by example " created by the rust community. This repository is for my reference to learn an make notes on the fundamentals of the rust language.

Primary LanguageRustMIT LicenseMIT

Learning-Rust

Learning Rust by example.

Rust docker image setup

1. Build the docker image 'rust' from the docker file rust.Dockerfile.

docker build -t rust -f Envs/rust.Dockerfile Envs

Building the image may take 5 to 15 mins. This is done only for the first time.

2. Run a container called rust from the built image.

For windows cmd

docker run --rm -d -t --name=rust -v %cd%:/home/mount rust 

For Mac terminal OR windows powershell

docker run --rm -d -t --name=rust -v ${PWD}:/home/mount rust

For linux terminal

docker run --rm -d -t --name=rust -v $(pwd):/home/mount rust

3. Open a interactive terminal from the running rust container.

docker exec -ti rust bash

4. Run any files from within the shell.

ls
cd Arrays
cd two_sum
node two_sum.js

5. To stop and remove the running container.

docker stop rust