Browse Source

adding Dockerfile for rust

pull/1/head
Jason Williams 6 years ago
parent
commit
6c31e52b23
  1. 5
      .editorConfig
  2. 8
      .vscode/launch.json
  3. 21
      Dockerfile
  4. 14
      Makefile
  5. 1
      src/bin/bin.rs

5
.editorConfig

@ -0,0 +1,5 @@
root = true
[{Makefile,**.mk}]
# Use tabs for indentation (Makefiles require tabs)
indent_style = tab

8
.vscode/launch.json vendored

@ -8,13 +8,13 @@
"type": "lldb",
"request": "launch",
"name": "Launch",
"program": "${workspaceFolder}/target/debug/bin",
"args": [],
"cwd": "${workspaceFolder}",
"program": "./target/debug/bin",
"cwd": "${workspaceRoot}",
"stopOnEntry": false,
"sourceLanguages": [
"rust"
],
"stopOnEntry": true
]
},
{
"name": "(Windows) Launch",

21
Dockerfile

@ -0,0 +1,21 @@
FROM rust:latest
WORKDIR /usr/src/myapp
COPY . .
# LLDB Server
EXPOSE 9228
RUN apt-get update \
apt-get upgrade \
apt-get install -y software-properties-common
# https://askubuntu.com/questions/787383/how-to-install-llvm-3-9
# http://apt.llvm.org/
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN apt-add-repository "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-6.0 main"
RUN apt-get update
RUN apt-get install clang-6.0 lldb-6.0
CMD ["/bin/bash"]

14
Makefile

@ -0,0 +1,14 @@
docker-build:
docker build --tag boa .
docker-container:
docker create --tty --interactive \
--name boa \
--hostname boa \
--volume ${PWD}/:/usr/src/myapp \
--publish 9228:9228 \
boa
docker-clean:
docker rm boa || echo "no container"
docker rmi boa || echo "no image"

1
src/bin/bin.rs

@ -7,4 +7,5 @@ pub fn main() {
let mut lexer = Lexer::new(&buffer);
lexer.lex().expect("finished");
println!("{:?}", lexer.tokens);
println!("Hello World");
}

Loading…
Cancel
Save