Skip to content

Commit

Permalink
Update Docker image in README.md files
Browse files Browse the repository at this point in the history
The Docker image used in the README.md files has been updated from ubuntu:latest to alpine:latest. This change affects the compiled_starters and
solutions directories for the following languages: C, Go, Nim, PHP, Python, Ruby, Rust, and Swift. The change was made in the course-definition.yml and
starter_templates directories as well.

Commit message: "Update Docker image to alpine:latest in README.md files"
  • Loading branch information
rohitpaulk committed May 13, 2024
1 parent 70ae22e commit 535abc1
Show file tree
Hide file tree
Showing 18 changed files with 31 additions and 33 deletions.
2 changes: 1 addition & 1 deletion compiled_starters/c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" m
You can now execute your program like this:

```sh
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```
2 changes: 1 addition & 1 deletion compiled_starters/go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" m
You can now execute your program like this:

```sh
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```
2 changes: 1 addition & 1 deletion compiled_starters/nim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" m
You can now execute your program like this:

```sh
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```
2 changes: 1 addition & 1 deletion compiled_starters/php/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" m
You can now execute your program like this:

```sh
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```
2 changes: 1 addition & 1 deletion compiled_starters/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" m
You can now execute your program like this:

```sh
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```
2 changes: 1 addition & 1 deletion compiled_starters/ruby/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" m
You can now execute your program like this:

```sh
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```
2 changes: 1 addition & 1 deletion compiled_starters/rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" m
You can now execute your program like this:

```sh
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```

This command compiles your Rust project, so it might be slow the first time you
Expand Down
2 changes: 1 addition & 1 deletion compiled_starters/swift/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" m
You can now execute your program like this:

```sh
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```
16 changes: 8 additions & 8 deletions course-definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ stages:
be executed similar to `docker run`:
```
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```
[docker-explorer](https://github.com/codecrafters-io/docker-explorer) is a custom test program that exposes
commands like `echo` and `ls`.
For now, don't worry about pulling the `ubuntu:latest` image. We will just
For now, don't worry about pulling the `alpine:latest` image. We will just
execute a local program for this stage and print its output. You'll work on
pulling images from Docker Hub in stage 6.
marketing_md: |-
Expand All @@ -103,7 +103,7 @@ stages:
Like the last stage, the tester will run your program like this:
```
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```
To test this behaviour locally, you could use the `echo` + `echo_stderr`
Expand Down Expand Up @@ -137,7 +137,7 @@ stages:
Just like the previous stage, the tester will run your program like this:
```
mydocker run ubuntu:latest /usr/local/bin/docker-explorer exit 1
mydocker run alpine:latest /usr/local/bin/docker-explorer exit 1
```
marketing_md: |-
In this stage, you'll wait for the child program's exit code and exit with
Expand Down Expand Up @@ -192,7 +192,7 @@ stages:
Just like the previous stage, the tester will run your program like this:
```
mydocker run ubuntu:latest /usr/local/bin/docker-explorer ls /some_dir
mydocker run alpine:latest /usr/local/bin/docker-explorer ls /some_dir
```
marketing_md: |-
In this stage, you'll restrict a program's access to the host filesystem
Expand Down Expand Up @@ -224,7 +224,7 @@ stages:
Just like the previous stage, the tester will run your program like this:
```
mydocker run ubuntu:latest /usr/local/bin/docker-explorer mypid
mydocker run alpine:latest /usr/local/bin/docker-explorer mypid
```
marketing_md: |-
In this stage, you'll restrict a program's access to the host's process
Expand Down Expand Up @@ -257,13 +257,13 @@ stages:
The tester will run your program like this:
```
mydocker run ubuntu:latest /bin/echo hey
mydocker run alpine:latest /bin/echo hey
```
The image used will be an [official
image](https://docs.docker.com/docker-hub/official_images/) from Docker
Hub. For example: [`alpine:latest`](https://hub.docker.com/_/alpine),
[`ubuntu:latest`](https://hub.docker.com/_/ubuntu),
[`alpine:latest`](https://hub.docker.com/_/alpine),
[`busybox:latest`](https://hub.docker.com/_/busybox). When interacting with the
Registry API, you'll need to prepend `library/` to the image names.
Expand Down
2 changes: 1 addition & 1 deletion solutions/c/01-init/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" m
You can now execute your program like this:

```sh
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```
2 changes: 1 addition & 1 deletion solutions/go/01-init/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" m
You can now execute your program like this:

```sh
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```
2 changes: 1 addition & 1 deletion solutions/nim/01-init/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" m
You can now execute your program like this:

```sh
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```
2 changes: 1 addition & 1 deletion solutions/php/01-init/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" m
You can now execute your program like this:

```sh
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```
2 changes: 1 addition & 1 deletion solutions/python/01-init/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" m
You can now execute your program like this:

```sh
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```
2 changes: 1 addition & 1 deletion solutions/ruby/01-init/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" m
You can now execute your program like this:

```sh
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```
2 changes: 1 addition & 1 deletion solutions/rust/01-init/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" m
You can now execute your program like this:

```sh
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```

This command compiles your Rust project, so it might be slow the first time you
Expand Down
2 changes: 1 addition & 1 deletion solutions/swift/01-init/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" m
You can now execute your program like this:

```sh
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```
16 changes: 7 additions & 9 deletions starter_templates/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
![progress-banner](https://codecrafters.io/landing/images/default_progress_banners/docker.png)


This is a starting point for {{language_name}} solutions to the
["Build Your Own Docker" Challenge](https://codecrafters.io/challenges/docker).

Expand All @@ -15,11 +14,11 @@ registry API](https://docs.docker.com/registry/spec/api/) and much more.

# Passing the first stage

The entry point for your Docker implementation is `{{ user_editable_file }}`.
The entry point for your Docker implementation is `{{ user_editable_file }}`.
Study and uncomment the relevant code, and push your changes to pass the first stage:

``` sh
git add .
```sh
git add .
git commit -m "pass 1st stage" # any msg
git push origin master
```
Expand All @@ -31,14 +30,14 @@ That's all!
Note: This section is for stages 2 and beyond.

You'll use linux-specific syscalls in this challenge. so we'll run
your code _inside_ a Docker container.
your code _inside_ a Docker container.

Please ensure you have
Please ensure you have
[Docker installed](https://docs.docker.com/get-docker/) locally.

Next, add a [shell alias](https://shapeshed.com/unix-alias/):

``` sh
```sh
alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" mydocker'
```

Expand All @@ -47,10 +46,9 @@ alias mydocker='docker build -t mydocker . && docker run --cap-add="SYS_ADMIN" m
You can now execute your program like this:

```sh
mydocker run ubuntu:latest /usr/local/bin/docker-explorer echo hey
mydocker run alpine:latest /usr/local/bin/docker-explorer echo hey
```

{{# language_is_rust }}This command compiles your
Rust project, so it might be slow the first time you run it. Subsequent runs
will be fast.{{/ language_is_rust}}

0 comments on commit 535abc1

Please sign in to comment.