Merge pull request #7 from codecrafters-io/sync
Sync with languages repo
This commit is contained in:
commit
834990434e
18
README.md
18
README.md
@ -12,7 +12,7 @@ we'll learn about [chroot](https://en.wikipedia.org/wiki/Chroot),
|
|||||||
|
|
||||||
# Passing the first stage
|
# Passing the first stage
|
||||||
|
|
||||||
The entry point for your Docker implementation is in `src/main.rs`. Study and
|
The entry point for your Docker implementation is `src/main.rs`. Study and
|
||||||
uncomment the relevant code, and push your changes to pass the first stage:
|
uncomment the relevant code, and push your changes to pass the first stage:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@ -31,26 +31,18 @@ That's all!
|
|||||||
1. Commit your changes and run `git push origin master` to submit your solution
|
1. Commit your changes and run `git push origin master` to submit your solution
|
||||||
to CodeCrafters. Test output will be streamed to your terminal.
|
to CodeCrafters. Test output will be streamed to your terminal.
|
||||||
|
|
||||||
# Running your program locally
|
### Running your program locally
|
||||||
|
|
||||||
Since you'll need to use linux-specific syscalls in this challenge, we'll run
|
Since you'll need to use linux-specific syscalls in this challenge, we'll run
|
||||||
your code _inside_ a docker container.
|
your code _inside_ a Docker container.
|
||||||
|
|
||||||
```sh
|
Start by adding a [shell alias](https://shapeshed.com/unix-alias/):
|
||||||
docker build -t my_docker . && docker run --cap-add="SYS_ADMIN" my_docker run some_image /usr/local/bin/docker-explorer echo hey
|
|
||||||
```
|
|
||||||
|
|
||||||
(The `--cap-add="SYS_ADMIN"` flag is required to create
|
|
||||||
[PID Namespaces](https://man7.org/linux/man-pages/man7/pid_namespaces.7.html))
|
|
||||||
|
|
||||||
To make this easier to type out, you could add a
|
|
||||||
[shell alias](https://shapeshed.com/unix-alias/):
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" mydocker'
|
alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" mydocker'
|
||||||
```
|
```
|
||||||
|
|
||||||
You can then execute your program like this:
|
You can now execute your program like this:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
|
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
|
||||||
|
Loading…
x
Reference in New Issue
Block a user