{"id":19142858,"url":"https://github.com/angatar/whalecome","last_synced_at":"2025-08-15T23:09:27.699Z","repository":{"id":41871631,"uuid":"429426094","full_name":"Angatar/whalecome","owner":"Angatar","description":"A small container (alpine based) to serve as training material for an initiation training class on Docker with ~no code.","archived":false,"fork":false,"pushed_at":"2025-07-18T02:36:15.000Z","size":42,"stargazers_count":2,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-18T06:46:51.769Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Angatar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-11-18T12:43:56.000Z","updated_at":"2022-09-01T20:11:08.000Z","dependencies_parsed_at":"2024-06-19T02:28:35.819Z","dependency_job_id":"a093f7e0-7a51-4f8e-ade0-c9832e0bd082","html_url":"https://github.com/Angatar/whalecome","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Angatar/whalecome","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Angatar%2Fwhalecome","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Angatar%2Fwhalecome/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Angatar%2Fwhalecome/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Angatar%2Fwhalecome/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Angatar","download_url":"https://codeload.github.com/Angatar/whalecome/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Angatar%2Fwhalecome/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270644754,"owners_count":24621332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T07:28:54.237Z","updated_at":"2025-08-15T23:09:27.669Z","avatar_url":"https://github.com/Angatar.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Docker Pulls](https://img.shields.io/docker/pulls/d3fk/whalecome) ![Docker Cloud Automated build](https://img.shields.io/docker/cloud/automated/d3fk/whalecome) ![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/d3fk/whalecome) ![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/d3fk/whalecome) ![Docker Stars](https://img.shields.io/docker/stars/d3fk/whalecome) [![GitHub license](https://img.shields.io/github/license/Angatar/whalecome)](https://github.com/Angatar/whalecome/blob/master/LICENSE)\n# whalecome (Angatar\u003e d3fk/whalecome)\nA small container (alpine based) to serve as training material for training classes on Docker (ProDev, CESAR, CNRS DR12) with almost no code (text/ascii files are mainly manipulated).\n\nIt contains a few additional packages + a small sh script that displays a Whalecome message and allows the user to display a \"Hello world!\" in different ways.\n\nThrough the use of this container in its 2 versions (cf available tags) the user/student is invited to understand:\n- basic docker run commands\n- the containers lifecycles: run, stop, start, rm\n- how to make a container continues running by using a pending command\n- basic docker exec commands\n- how to get information on a container image layers by using docker history\n- the use of CMD in Dockerfile\n- interactions with the container through CMD on run\n- the use of ENTRYPOINT in Dockerfile\n- interactions with the container by overriding the entrypoint on run\n- the use of ENV\n- interactions with the container by overriding the ENV variables on run\n- how to use docker inspect to get information\n- copy content from a container\n- the use of volumes to add contents to the container\n- the use of images tags\n- how to clean the mess: remove stopped containers, unused images ...\n- how to build his own image from an existing image\n\n\n## Docker image\npre-build from Docker hub with \"automated build\" option.\n\nimage name **d3fk/whalecome**\n\n`docker pull d3fk/whalecome`\n\nDocker hub repository: https://hub.docker.com/r/d3fk/whalecome/\n\n\n## Available tags\n- **d3fk/whalecome:latest** this image makes use of ENTRYPOINT and CMD\n- **d3fk/whalecome:master** this image is simply another tag for **d3fk/whalecome:latest**, they are identical images\n- **d3fk/whalecome:cmd** this image makes use of CMD only\n\n\n## Basic usage\n\n```sh\ndocker run d3fk/whalecome\n```\n\n## Initiation to Docker: learning steps\n\n0. **basics**\n\n  - **View available commands**\n  ```sh\n  docker --help\n  ```\n\n  - **View subcommands details**\n  ```sh\n  docker {command} --help\n  ```\n  e.g:\n\n  ```sh\n  docker run --help\n  ```\n\n1. **basic run of a container**\n```sh\ndocker run d3fk/whalecome\n```\nNote: if no image tag is mentioned, the **:latest** image tag is automatically used\n\n2. **containers stop when their running process ends**\n```sh\ndocker ps\n```\n...shows nothing\n```sh\ndocker ps -f \"status=exited\"\n```\n...shows our container that is stopped\n\n3. **Trying to understand how the image of the container was created**\n```sh\ndocker history d3fk/whalecome\n```\nWe can see the different instructions that were used to build the intermediary layers of the image.\n\nTo get the complete instructions used by each layer, use\n\n```sh\ndocker history --no-trunc d3fk/whalecome\n```\n\n4. **interacting with the container by overriding the CMD instruction**\n```sh\ndocker run d3fk/whalecome world !\n```\nThe unicorn now says \"Hello world ! !\"\n\n5. **interacting with the container by changing an ENV variable**\n    - Changing the default message for a 'Hello World !'\n```sh\ndocker run --env MESSAGE='Hello World !' d3fk/whalecome\n```\n5. **bis: interacting with the container by changing another ENV variable**\n    - This whale is too gentle, we need a more serious whale:\n```sh\ndocker run --env WHALE_DRAWN=serious_whale.ascii d3fk/whalecome serious whale !\n```\n\n6. **importing data: first use of volumes**\nThe serious whale do not looks like the official Docker whale:\n\nIt seems the file is well in this repo but not in the container:\n  - 0. **Create a whalecome dir and cd into it**\n  - 1. **We need to get the file from the repo:**\n  As you have docker installed you are at 1 docker command to run any containerized program that run on Linux (since we are only using Linux container in this training class) ... so you also can use a containerized git\n  ```sh\n  docker run --name git alpine/git clone https://github.com/Angatar/whalecome\n  ```\n  Note that we have used the --name option here to give a name to our container\n\n  - 2. **Great! It says ```Cloning into 'whalecome'...``` but where is my cloned repo?**\n  Answer: it is into \"the container\" (namely git), as a property of containers is to be isolated and can't have access by default to the host's file system.\n\n  A Bind mount of the host path into the container would have permit to get the cloned repo in our file system\n\n  - 3. **Do we need to make use of volumes or bind mounts to get the repo in our file system?**\n  Usually yes(cf alpine/git description), but in this case NO since we only need to get 1 file from this repo.\n\n  We are going to copy it from the stopped container... but we need to have more information\n  ```sh\n  docker history alpine/git\n  ```\n  ... the image history says that the the workdir is /git so we can expect to find our cloned repo in /git/whalecome/\n\n  ```sh\n  docker cp git:/git/whalecome/docker_whale.ascii .\n  ```\n  Note that having named our container allows us to call it with its known name... otherwise the container ID or its random Name should have been retrieved from ```docker ps -a``` to be used here.\n\n  - 4. **Use a bind mount to import data into a container**\n  The file is now on your host file system and we are going to use a bind mount to mount it into our d3fk/whalecome container.\n\n  Let say the Docker whale is also a gentle whale\n  ```sh\n  docker run -v $(pwd)/docker_whale.ascii:gentle_whale.ascii d3fk/whalecome docker whale !\n  ```\n  Note: in PowerShell replace `$(pwd)/` by `${pwd}\\`\n\n  - 4. **bis** use a volume to add content in the container\n  The history of the alpine/git repo also shows that an unnamed volume is automatically created when running the alpine/git container.\n\n  Lets see if we can use this volume\n  ```sh\n  docker inspect git\n  ```\n  As it is an unnamed volume a random name is generated by Docker ... get this name in the section\n  ```sh\n  \"Mounts\":[\n    {\n       \"Type\": \"volume\",\n               \"Name\": \"28100632badb865e174533cfe00e9d40300d0c1364b5ff8372582394606a77ef\",\n  ...\n  ```\n  For reading purpose of the next docker command we'll define here a shell var (use the name of your volume as value)\non Linux shell\n  ```sh\n  GIT_VOLUME=\"28100632badb865e174533cfe00e9d40300d0c1364b5ff8372582394606a77ef\"\n  ```\n  or on PowerShell an env var\n  ```sh\n  $ENV:GIT_VOLUME=\"28100632badb865e174533cfe00e9d40300d0c1364b5ff8372582394606a77ef\"\n  ```\n  Then we can run a new container with the GIT_VOLUME mounted where we want\n\n  ```sh\n  docker run -v $GIT_VOLUME:/repo/ --env WHALE_DRAWN='/repo/whalecome/docker_whale.ascii' d3fk/whalecome docker whale !\n  ```\n  on PowerShell replace `$GIT_VOLUME` by `${ENV:GIT_VOLUME}`\n\n  Volumes can only be fully mounted in the container but you can choose their destinations.\n\n7. **Wait a minute! Have a look at our stopped containers, we need to clean this mess before going further!**\n  - 0. **display all containers**\n  ```sh\n  docker ps -a\n  ```\n  - 1. **clean all the stopped containers**\n  ```sh\n  docker rm  $(docker ps -aq -f \"status=exited\")\n  ```\n  Note:```docker rm -f (...``` would also force all running containers to stop and remove them)\n\n  ...If you have a recent docker-engine use the container manager (you can use -f to not have the confirmation prompt):\n  ```sh\n  docker container prune\n  ```\n  Why prune?: because it is well known that the prunes help to clean the system ;)\n\n  - 2. **and the volumes?**\n  ```sh\n  docker volume ls\n  ```\n  You can remove the volumes you want by using\n  ```sh\n  docker volume rm VOLUME_NAME\n  ```\n  Note: Several volume names can be listed for removal\n\n  You can also use the prune to remove all unused local Volumes\n  ```sh\n  docker volume prune -a\n  ```\n  - 3. **and the images?**\n  as well ... to list them\n  ```sh\n  docker images\n  ```\n  ... and to remove all images (the -f force removal)\n\n  ```sh\n  docker rmi -f $(docker images -q)\n  ```\n\n  If you have a docker engine with image manager there is also a prune option to remove unused images only\n  ```sh\n  docker image prune -a\n  ```\n  Note \"image\" here instead of image**s** (the -f here will only avoid prompt)\n\n8. **You've lost your d3fk/whalecome image? Don't worry we can download it or update it by pull**\n```sh\ndocker pull d3fk/whalecome\n```\nDoes it still work?\n\nNote: To avoid to have to clean too often our stopped containers we'll now use the --rm option of the run command)\n```sh\ndocker run --rm d3fk/whalecome again\n```\n\n9. **The container default entrypoint can be overriden on run**\n```sh\ndocker run --rm --entrypoint echo d3fk/whalecome I can take control ...\n```\n\n10. **docker images can exists in different versions (tag)**\nThe d3fk/whalecome:cmd images do not makes use of an entrypoint but only CMD, allowing you to override easily the default CMD by passing a command after the name of the container\n```sh\ndocker run --rm d3fk/whalecome:cmd figlet -k Docker rocks !\n```\n\n11. **making d3fk/whalecome:cmd container pending by changing the CMD**\n```sh\ndocker run --rm -d --name whalecome d3fk/whalecome:cmd tail -f /dev/null\n```\nNote the **-d** option (detach) otherwise our command would have been stuck waiting the end of process: ( in that case you would have need to open a new console)\nNote the **--name** option\n```sh\ndocker ps\n```\nWe can see our container running ... it will run until its process ends (tail -f)\n\n12. **Interacting with a running container**\nIt is possible to interact/enter into a running container with the \"docker exec\" command e.g.\n\n```sh\ndocker exec whalecome ls\n```\n**whalecome**, here, is the name of the running container and not the image\n\nWe can see the content of the WORKDIR (/files)\n\nWe could also break into the container with a shell terminal\n\n```sh\ndocker exec -it whalecome sh\n```\nNote the **-it** options that means respectively interactive(allow stdin) and terminal (including session and prompt)\nYou are in a shell terminal into the  and see the process running into the container\n\n```sh\n$ ps\n```\nand kill the running process which would stop the container and as the --rm option was provided to the run command the container would be completely removed\n\nThe normal cycle of the container is run, stop, start (restart) the stopped container, and finally be removed\n\nto exit the container's terminal, type\n```sh\n$ exit\n```\n\nstop the container\n```sh\ndocker stop whalecome\n```\n\nCheck that no container remains either running or stopped\n\n13. **Create your own container image**\nIn order to create your own whalecome image you have to create a Dockerfile that will detail how the image will be created.\n...Guess what you can use to edit the Dockerfile ... docker, of course (e.g.: the busybox container contains a set of lightweight linux tools, including one of the best code editor ever = vi )\n```sh\ndocker run -v $(pwd):/tmp -w /tmp -it busybox vi Dockerfile\n```\nNote: in PowerShell replace `$(pwd)/` by `${pwd}\\`\nNote2: we are using -v to create a bind mount with the current host's directory to /tmp in the container\nNote3: as busybox does not declare a workdir, we use the **-w** option to define it ... at the same place we have created the bind mount in the container so that our command passed to the container will take effect in this directory = in our current directory\n... if you are not comfortable with vi/vim, you can of course use your favorite code editor.\n\nAdd to the files the following instructions to the Dockerfile (feel free to adapt to your needs)\n```dockerfile\nFROM d3fk/whalecome:cmd\nCOPY docker_whale.ascii /files/\nENV MESSAGE=\"Whalecome among Docker users !\"\nENV FONT_NAME=\"big\"\nENV WHALE_DRAWN=docker_whale.ascii\n```\nOur image starts from the container indicated in the **FROM** line and so it will inherit of its characteristics.\nWe only overwritte or add instructions to addapt our container from the **FROM** image.\ntype ```:wq``` to save and quit 'vi' and so exit the container(since the pending process will end)\n\nIn order to build your image you'll have to use ```docker build``` command\n```sh\ndocker build -t whalecome:me .\n```\nGreat! you have created your first docker image(a whalecome image with the tag **me**), it is stored with your local images; to list them type\n```sh\ndocker images\n```\nor\n```sh\ndocker image ls\n```\n\nYou can now use **your own** whalecome image\n```sh\ndocker run --rm whalecome:me\n```\n\nIn case you wish to add your image to a docker registry (public or private) you will need to log in with your credential by using\n```sh\ndocker login\n```\nThe local image you will share on the registry also needs to be named properly to be placed in **your** repository on the registry\n\n```sh\ndocker tag whalecome:me (REGISTRY/PATH/USER_ID)/whalecome:me\n```\nIf you are using the default public registry (Docker Hub) the ```USER_ID/whalecome:me``` information is sufficient.\n\nNote: the **:tag** information of the image is not compulsory, it case it is not indicated, the **:latest** tag is automatically attributed to the image.\n\nNow push it to share it on your registry\n```sh\ndocker push (REGISTRY/PATH/USER_ID)/whalecome:me\n```\n----\n## CONGRATULATION!\nYou are ready for the next level :)\n\nWe have now enough explored the d3fk/whalecome containers, lets now see another one :\"d3fk/asciinematic\"\n\n\n\n[![GitHub license](https://img.shields.io/github/license/Angatar/whalecome)](https://github.com/Angatar/whalecome/blob/master/LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangatar%2Fwhalecome","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangatar%2Fwhalecome","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangatar%2Fwhalecome/lists"}