-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dockerfile for chapters/mitigations-and-defensive-strategies, 01-…
…rwslotmachine1 Signed-off-by: ClaraStefania <[email protected]>
- Loading branch information
1 parent
2d21544
commit 4d1f4b3
Showing
3 changed files
with
49 additions
and
14 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
...s-and-defensive-strategies/defense-mechanisms/activities/01-rwslotmachine1/sol/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Stage 1: Build Stage | ||
FROM gcc:latest AS build | ||
|
||
WORKDIR /app | ||
|
||
COPY rwslotmachine1.c . | ||
|
||
# Compile the C code into an executable | ||
RUN gcc -Wall -Wextra -O2 -o rwslotmachine1 rwslotmachine1.c | ||
|
||
# Stage 2: Runtime Stage | ||
FROM ubuntu:latest | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=build /app/rwslotmachine1 /app/rwslotmachine1 | ||
|
||
EXPOSE 31344 | ||
|
||
# Run the application | ||
CMD ["./rwslotmachine1"] |
12 changes: 12 additions & 0 deletions
12
...ensive-strategies/defense-mechanisms/activities/01-rwslotmachine1/sol/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
## Building and running | ||
|
||
1. Build the Dockerfile | ||
```bash | ||
docker build -t ransomware1 . | ||
``` | ||
|
||
2. Run the Dockerfile | ||
```bash | ||
docker run -it -p 31344:31344 ransomware1 | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters