Introduction
Ahoy, Docker explorer! You've mastered running your first container, and now it's time for some nautical fun. In this challenge, you'll make a Docker whale speak by running a command inside a container. Get ready to dive deeper into the ocean of containerization!
Run a Container and Make It Speak
Tasks
Your mission, should you choose to accept it, is:
- Run a Docker container that can generate ASCII art of a talking whale.
- Make the whale say "Ahoy, Docker"
Requirements
To successfully complete this challenge, you must:
- Use the
docker runcommand to start the container. - Use the image
docker/whalesay. - Use the
cowsaycommand inside the container to make the whale speak "Ahoy, Docker". - Execute the command in the
~/projectdirectory.
Hints
To run a command inside a Docker container as you start it, you can append the command after the image name in your docker run command. The general structure is:
docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
In this case, you'll want to run the cowsay command with your desired message as an argument.
Example
When you successfully complete the challenge, you should see output similar to this:
______________
< Ahoy, Docker >
--------------
\
\
\
### .
### ### ### ==
### ### ### ### ===
/""""""""""""""""___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\______/
Summary
Congratulations, captain! In this challenge, you've sailed into new Docker waters by not only running a container but also executing a command inside it. You've used the docker run command to start a container from the docker/whalesay image and made it generate a speaking whale ASCII art.
This exercise builds on your basic Docker skills and introduces the concept of running commands inside containers. You've learned that containers can do more than just run with their default settings - they can accept commands to perform specific tasks.
As you continue your Docker journey, remember that this pattern of running containers with specific commands is a fundamental skill in containerization. It allows you to use containers flexibly for various tasks, from generating ASCII art to running complex applications. Keep exploring, and may your Docker adventures be whale-y exciting!



