Skip to content

Commit 705ab45

Browse files
authored
Add Docker support with build and run scripts (#12)
2 parents 6f72ba8 + 6fd22e3 commit 705ab45

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

build-docker-image.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker build -t my-rust-app .

dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM rust:latest
2+
3+
# Set the working directory inside the container
4+
WORKDIR /usr/src/myapp
5+
6+
# Copy the current directory contents into the container at /usr/src/myapp
7+
COPY . .
8+
9+
# Default command to build and test the project when the container starts
10+
CMD ["sh", "-c", "cargo build --release --verbose && cargo test --release --verbose"]

run-build-in-docker.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker run --rm -v ${pwd}:/usr/src/myapp my-rust-app

0 commit comments

Comments
 (0)