Skip to content

Commit

Permalink
Dockerize Level 1 Onboarding (#79)
Browse files Browse the repository at this point in the history
# Purpose
PR for
[this](https://www.notion.so/uworbital/Improve-dev-env-setup-for-level1-challenge-7b494c39e0934b23aeff297c255741bf?pvs=4)

# New Changes
Dockerfile added, using Ubuntu, GCC and Make. Updated README.md with new
instructions.

# Testing
Able to build container and run it locally.

# Outstanding Changes
N/a.
  • Loading branch information
farzanmirshekari authored Aug 27, 2023
1 parent 2b3ff96 commit 6df21af
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM ubuntu:latest

WORKDIR /app

RUN apt-get update && apt-get install -y gcc make
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
# C Programming Challenge - Level 1

This mini-challenge is intended to test your knowledge of C programming. There are 13 C programming questions that can be found in the challenge.c file. Your solution to this challenge will be verified automatically on a standard Linux machine once you make a pull request.
This mini-challenge is intended to test your knowledge of C programming. There are 13 C programming questions that can be found in the `challenge.c` file. Your solution to this challenge will be verified automatically on a standard Linux machine once you make a pull request.

If you'd like to test your solution locally, make sure you have Make and GCC for your system installed.
To test your solutions locally, you can use the provided Dockerfile to build a Docker image that will run the tests for you.

To test your solution, run:
```sh
If you do not have Docker installed on your machine, you can follow the instructions <a href="https://www.notion.so/uworbital/How-To-Docker">here</a>.

To build the Docker image, run:
```
docker build -t fw-onboarding-level1 .
```

You can then run the container with:
```
docker run -it --rm -v $(pwd):/app fw-onboarding-level1 /bin/bash
```

This will open a bash shell inside the container. From there, you can begin working on the challenge. You can stay in the container as long as you want, and you can exit the container by typing `exit`.
In order to test your solutions, you'll need to compile the challenge.c file. You can do this by running the following commands in the bash shell:
```
make clean
make all
./build/challenge # Or ./build/challenge.exe on Windows
./build/challenge
```
This will use the provided Makefile to compile the `challenge.c` file and run the resulting executable.

If you've answered all the questions correctly, you'll pass all the test cases. There should be zero build errors/warnings.

0 comments on commit 6df21af

Please sign in to comment.