From 535abc1a41cb678d13c3d997471d378cb994970b Mon Sep 17 00:00:00 2001 From: Paul Kuruvilla Date: Mon, 13 May 2024 13:25:05 +0100 Subject: [PATCH] Update Docker image in README.md files 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" --- compiled_starters/c/README.md | 2 +- compiled_starters/go/README.md | 2 +- compiled_starters/nim/README.md | 2 +- compiled_starters/php/README.md | 2 +- compiled_starters/python/README.md | 2 +- compiled_starters/ruby/README.md | 2 +- compiled_starters/rust/README.md | 2 +- compiled_starters/swift/README.md | 2 +- course-definition.yml | 16 ++++++++-------- solutions/c/01-init/code/README.md | 2 +- solutions/go/01-init/code/README.md | 2 +- solutions/nim/01-init/code/README.md | 2 +- solutions/php/01-init/code/README.md | 2 +- solutions/python/01-init/code/README.md | 2 +- solutions/ruby/01-init/code/README.md | 2 +- solutions/rust/01-init/code/README.md | 2 +- solutions/swift/01-init/code/README.md | 2 +- starter_templates/README.md | 16 +++++++--------- 18 files changed, 31 insertions(+), 33 deletions(-) diff --git a/compiled_starters/c/README.md b/compiled_starters/c/README.md index ea5215c..899dc43 100644 --- a/compiled_starters/c/README.md +++ b/compiled_starters/c/README.md @@ -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 ``` diff --git a/compiled_starters/go/README.md b/compiled_starters/go/README.md index 9f4aced..c8299ef 100644 --- a/compiled_starters/go/README.md +++ b/compiled_starters/go/README.md @@ -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 ``` diff --git a/compiled_starters/nim/README.md b/compiled_starters/nim/README.md index fd88de4..b6d19f3 100644 --- a/compiled_starters/nim/README.md +++ b/compiled_starters/nim/README.md @@ -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 ``` diff --git a/compiled_starters/php/README.md b/compiled_starters/php/README.md index 2683720..cd9c527 100644 --- a/compiled_starters/php/README.md +++ b/compiled_starters/php/README.md @@ -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 ``` diff --git a/compiled_starters/python/README.md b/compiled_starters/python/README.md index 355b5c0..26d607d 100644 --- a/compiled_starters/python/README.md +++ b/compiled_starters/python/README.md @@ -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 ``` diff --git a/compiled_starters/ruby/README.md b/compiled_starters/ruby/README.md index 9684f9a..23d0ddd 100644 --- a/compiled_starters/ruby/README.md +++ b/compiled_starters/ruby/README.md @@ -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 ``` diff --git a/compiled_starters/rust/README.md b/compiled_starters/rust/README.md index 52ff12e..5c54d3f 100644 --- a/compiled_starters/rust/README.md +++ b/compiled_starters/rust/README.md @@ -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 diff --git a/compiled_starters/swift/README.md b/compiled_starters/swift/README.md index 07525aa..b7eb985 100644 --- a/compiled_starters/swift/README.md +++ b/compiled_starters/swift/README.md @@ -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 ``` diff --git a/course-definition.yml b/course-definition.yml index 3154e64..1ba204b 100644 --- a/course-definition.yml +++ b/course-definition.yml @@ -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: |- @@ -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` @@ -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 @@ -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 @@ -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 @@ -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. diff --git a/solutions/c/01-init/code/README.md b/solutions/c/01-init/code/README.md index ea5215c..899dc43 100644 --- a/solutions/c/01-init/code/README.md +++ b/solutions/c/01-init/code/README.md @@ -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 ``` diff --git a/solutions/go/01-init/code/README.md b/solutions/go/01-init/code/README.md index 9f4aced..c8299ef 100644 --- a/solutions/go/01-init/code/README.md +++ b/solutions/go/01-init/code/README.md @@ -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 ``` diff --git a/solutions/nim/01-init/code/README.md b/solutions/nim/01-init/code/README.md index fd88de4..b6d19f3 100644 --- a/solutions/nim/01-init/code/README.md +++ b/solutions/nim/01-init/code/README.md @@ -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 ``` diff --git a/solutions/php/01-init/code/README.md b/solutions/php/01-init/code/README.md index 2683720..cd9c527 100644 --- a/solutions/php/01-init/code/README.md +++ b/solutions/php/01-init/code/README.md @@ -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 ``` diff --git a/solutions/python/01-init/code/README.md b/solutions/python/01-init/code/README.md index 355b5c0..26d607d 100644 --- a/solutions/python/01-init/code/README.md +++ b/solutions/python/01-init/code/README.md @@ -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 ``` diff --git a/solutions/ruby/01-init/code/README.md b/solutions/ruby/01-init/code/README.md index 9684f9a..23d0ddd 100644 --- a/solutions/ruby/01-init/code/README.md +++ b/solutions/ruby/01-init/code/README.md @@ -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 ``` diff --git a/solutions/rust/01-init/code/README.md b/solutions/rust/01-init/code/README.md index 52ff12e..5c54d3f 100644 --- a/solutions/rust/01-init/code/README.md +++ b/solutions/rust/01-init/code/README.md @@ -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 diff --git a/solutions/swift/01-init/code/README.md b/solutions/swift/01-init/code/README.md index 07525aa..b7eb985 100644 --- a/solutions/swift/01-init/code/README.md +++ b/solutions/swift/01-init/code/README.md @@ -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 ``` diff --git a/starter_templates/README.md b/starter_templates/README.md index 90c3373..b2d2d80 100644 --- a/starter_templates/README.md +++ b/starter_templates/README.md @@ -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). @@ -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 ``` @@ -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' ``` @@ -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}} -