Skip to content

Instantly share code, notes, and snippets.

@pavelnunez
Last active June 20, 2020 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavelnunez/dcff0af1c9eb2369972f2ebcad9fab1e to your computer and use it in GitHub Desktop.
Save pavelnunez/dcff0af1c9eb2369972f2ebcad9fab1e to your computer and use it in GitHub Desktop.

Contents

Naming convention for Images

Since we work with lots of images and container daily as time goes and container and images start piling up, we need to come up with a convenient way to name such objects inside Docker.

Here's a suggested naming convention for images:

[VENDOR]-[MAIN SOFTWARE]-[OPERATING SYSTEM]:[TAG]

XXX-YYY-ZZZZ:N.N.N.N-N.N.N.N = [3-3-4]:[7-7]

  Where XXX: Are 3 letters from the image software vendor.

  YYY: Are 3 letters from the image main software.

  XXXX: Are 4 letters from the OS used to build the image. 

Examples:

php-php-ubun:7.0-18.04 = Is PHP 7.0 from the vendor PHP.net running over Ubuntu 18.04 LTS.

mys-mys-fedo:8.0-30 = MySQL 8.0 from vendor MySQL over Fedora 30.

mic-sql-ws16:17.0-2016 = SQL Server 17.0 or 2016 from vendor Microsoft and running over Windows Server 2016.

Naming convention for Containers

[VENDOR]-[MAIN SOFTWARE]-[OPERATING SYSTEM]_[VERSION]

XXX-YYY-ZZZZ_N.N.N.N-N.N.N.N = [3-3-4]_[7-7]

Examples:

atl-jir-cent_8.2.3-8 = Jira 8.2.3 from Atlassian running over Centos 8 OS.

asf-kaf-ubun_2.2.0-18.04 = Kafka 2.2.0 from Apache Software Foundation running over Ubuntu 18.04 LTS.

As you can see it offers a more predictable way to name images and containers and offers a more organized way to display such names on console to commands such as docker ps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment