Skip to content

Commit 4910098

Browse files
Fixed running rust raffler in docker
1 parent d2a5aa6 commit 4910098

File tree

4 files changed

+6
-13
lines changed

4 files changed

+6
-13
lines changed

aochagavia-rust/Dockerfile

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
1-
FROM ubuntu:15.10
1+
FROM jimmycuadra/rust
22
33
ENV LANG C.UTF-8
44

5-
# Make sure add-apt-repository is installed
6-
RUN apt-get update
7-
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install software-properties-common
8-
9-
# Install Rust
10-
RUN yes | add-apt-repository ppa:hansjorg/rust
11-
RUN apt-get update
12-
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y rust-nightly curl
13-
RUN curl -sSf https://static.rust-lang.org/rustup.sh | sh
14-
155
# Create working dir
166
RUN mkdir -p /var/app
177
COPY . /var/app
188
WORKDIR /var/app
199

10+
RUN cargo build --release
11+
2012
# Run raffler
2113
CMD ["/var/app/run.sh"]

aochagavia-rust/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ fn main() {
2121
let chosen_one = rand::thread_rng().choose(&names)
2222
.expect("The list of names is empty");
2323

24-
println!("The winner is: {}", chosen_one);
24+
println!("{}", chosen_one);
2525
}

build.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env bash
22
set -e
33

4+
docker build -t aochagavia_rust_raffler aochagavia-rust
45
docker build -t shawnmccool_scala_raffler shawnmccool-scala
56
docker build -t basbl_zsh_raffler basbl-zsh
67
docker build -t lucasvanlierop_cobol_raffler lucasvanlierop-cobol

raffle.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ NAMES_FILE=`realpath $WORKING_DIR/$1`
1111
cp $NAMES_FILE $NAMES_DIR/current
1212

1313
# Raffle a raffler ;-)
14-
declare -a RAFFLER_NAMES=('basbl_zsh' 'lucasvanlierop_cobol' 'rjkip_elixir' 'sgoettschkes_haskell' 'shawnmccool_scala')
14+
declare -a RAFFLER_NAMES=('basbl_zsh' 'lucasvanlierop_cobol' 'rjkip_elixir' 'sgoettschkes_haskell' 'shawnmccool_scala' 'aochagavia_rust')
1515
RANDOM_RAFFLER=${RAFFLER_NAMES[$RANDOM % ${#RAFFLER_NAMES[@]} ]}
1616

1717
# run raffler in container with names dir mounted

0 commit comments

Comments
 (0)