mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-12 05:39:19 +00:00
finish intro
This commit is contained in:
parent
3309a01b5e
commit
de5b40e2ff
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -459,7 +459,7 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustlings"
|
name = "rustlings"
|
||||||
version = "5.1.1"
|
version = "5.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"argh",
|
"argh",
|
||||||
"assert_cmd",
|
"assert_cmd",
|
||||||
|
|||||||
13
Docker/Dockerfile
Normal file
13
Docker/Dockerfile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Pull base image.
|
||||||
|
FROM rust:latest
|
||||||
|
|
||||||
|
# Install rustlings
|
||||||
|
# WORKDIR /temp
|
||||||
|
# RUN curl -L https://raw.githubusercontent.com/rust-lang/rustlings/main/install.sh | bash
|
||||||
|
|
||||||
|
WORKDIR /temp
|
||||||
|
RUN apt-get update && apt-get install -y git
|
||||||
|
RUN git clone -b 5.1.1 --depth 1 https://github.com/rust-lang/rustlings
|
||||||
|
WORKDIR /temp/rustlings
|
||||||
|
RUN cargo install --force --path .
|
||||||
|
RUN rm -rf /temp/rustlings
|
||||||
2
Docker/build_image.sh
Normal file
2
Docker/build_image.sh
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
docker build -t rustlings .
|
||||||
22
Docker/run_docker.sh
Normal file
22
Docker/run_docker.sh
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
HOST_PATH=$PWD/..
|
||||||
|
|
||||||
|
# store a command history inside containers into this file
|
||||||
|
|
||||||
|
touch $HOME/.rustlings_history
|
||||||
|
|
||||||
|
xhost local:
|
||||||
|
|
||||||
|
sudo docker run --rm \
|
||||||
|
-v /tmp/.X11-unix/:/tmp/.X11-unix \
|
||||||
|
-v $HOST_PATH:/mnt/rustlings \
|
||||||
|
-v $HOME/.rustlings_history:/root/.bash_history \
|
||||||
|
-w /mnt/rustlings \
|
||||||
|
--sysctl fs.mqueue.msg_max=128 \
|
||||||
|
--ulimit msgqueue=8192000 \
|
||||||
|
--ulimit core=-1 \
|
||||||
|
--shm-size=12G \
|
||||||
|
--name rustlings \
|
||||||
|
-i -t rustlings:latest \
|
||||||
|
/bin/bash
|
||||||
@ -9,8 +9,6 @@
|
|||||||
// when you change one of the lines below! Try adding a `println!` line, or try changing
|
// when you change one of the lines below! Try adding a `println!` line, or try changing
|
||||||
// what it outputs in your terminal. Try removing a semicolon and see what happens!
|
// what it outputs in your terminal. Try removing a semicolon and see what happens!
|
||||||
|
|
||||||
// I AM NOT DONE
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello and");
|
println!("Hello and");
|
||||||
println!(r#" welcome to... "#);
|
println!(r#" welcome to... "#);
|
||||||
|
|||||||
@ -2,8 +2,6 @@
|
|||||||
// Make the code print a greeting to the world.
|
// Make the code print a greeting to the world.
|
||||||
// Execute `rustlings hint intro2` or use the `hint` watch subcommand for a hint.
|
// Execute `rustlings hint intro2` or use the `hint` watch subcommand for a hint.
|
||||||
|
|
||||||
// I AM NOT DONE
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello {}!");
|
println!("Hello {}!", "rustlings");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user