Quick Recap
Let's review what we have learned so far.
We'll cover the following
Highlights
Now that you have had your first taste of Docker, let’s review what we have learned.
-
We ran our first ever Docker command—a
helloworld
Ruby script—without needing Ruby installed in our environment by using:$ docker run ruby:2.7 ruby -e "puts :hello"
-
We saw how to list our running containers with
docker ps
and all containers (including stopped ones) withdocker ps -a
. -
We deleted old containers with
docker rm <container id>
and saw how to create throwaway containers using thedocker run
’s--rm
option. -
We generated a new Rails project using a container by:
-
starting an interactive Bash shell running inside a container by using:
$ docker run -i -t --rm -v ${PWD}:/usr/src/app ruby:2.7 bash
-
installing the Rails gem inside the container by
gem install rails
-
using the freshly installed Rails gem to generate our project with
$ rails new myapp --skip-test \ --skip-bundle
-
Nice. ✨ We are well on our way to Docker proficiency.
What to expect in the next chapter?
In the next chapter, we will learn how to run our new Rails application.
Get hands-on with 1400+ tech skills courses.