Kleyson Rios
Kleyson Rios

Reputation: 2867

Docker run using "some name/alias"

I have the following:

$ docker images
REPOSITORY                        TAG                 IMAGE ID              CREATED             SIZE
ubuntu-14.04/vertica-db           7.0.2-1_amd64       16aeed3aa559          3 days ago          785.5 MB

And to start a new docker machine:

docker run \
   -d -t \
   --name verticadb-test \
   -p 5433:5433 \
   --entrypoint="/docker-init.sh" \
   16aeed3aa559

Is it possible "run" a new machine using "some name" instead of the "IMAGE ID" ?

Every time that I build a new image I have to update a few script to update the "IMAGE ID". So, I would like to use some name/alias that I could run regardless the IMAGE ID.

Best Regards.

Upvotes: 1

Views: 367

Answers (1)

techtabu
techtabu

Reputation: 26937

You can use combination of image name and tag instead of image id.

docker run \
-d -t \
--name verticadb-test \
-p 5433:5433 \
--entrypoint="/docker-init.sh" \
ubuntu-14.04/vertica-db:7.0.2-1_amd64

Small clarification on your question. You actually run an 'image' and create a container when you are using docker run.

Upvotes: 4

Related Questions