Docker Tags

Reference: docker docs

What are docker tags?

Description

: Docker tag๋ฅผ ํ™œ์šฉํ•˜์—ฌ docker image๋“ค์˜ version์„ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค

Usage

: Docker์˜ tag ๋ช…๋ น์–ด๋ฅผ ์ด์šฉํ•˜์—ฌ ๊ธฐ์กด์— ๋งŒ๋“  image์— ์ถ”๊ฐ€๋กœ tag ๋ฅผ ์ง€์ •ํ•  ์ˆ˜ ์žˆ๋‹ค

docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]

What happens when you don't specify a tag?

latest tag

  • Docker image ์ƒ์„ฑ ์‹œ tag๋ช… ์ง€์ •์„ ์ƒ๋žตํ•˜๋ฉด, default ๊ฐ’์œผ๋กœ latest tag ๊ฐ€ ๋ถ™๋Š”๋‹ค

  • latest tag ๋Š” ํŠน์ • tag / version ์ง€์ • ์—†์ด ๋งˆ์ง€๋ง‰์œผ๋กœ build / tag ๋œ image๋ฅผ ์˜๋ฏธํ•œ๋‹ค

latest is Just a Tag, Doesn't Always Mean "Latest"

  • latest ๊ฐ€ ์‹ค์ œ๋กœ ๊ฐ€์žฅ ์ตœ์‹  version ์ž„์„ ์˜๋ฏธํ•˜์ง€ ์•Š๋Š”๋‹ค

    • :latest tag ๊ฐ€ ์–ธ์ œ๋‚˜ ๊ฐ€์žฅ ์ตœ๊ทผ์— push ๋œ image ๋ผ๊ณ  ์ƒ๊ฐ ํ•  ์ˆ˜ ์žˆ์ง€๋งŒ, ๊ทธ๋ ‡์ง€ ์•Š๋‹ค

    • latest๋Š” ๊ทธ์ € tag ๊ฐ€ ์—†๋Š” image์— ๋Œ€ํ•ด default ๊ฐ’์œผ๋กœ ์ฃผ์–ด์ง„ tag ์ด๋‹ค

  • latest ๋Š” ๋™์ ์ด์ง€ ์•Š๋‹ค

    • tag ๋ฅผ ๋ถ™์ด์ง€ ์•Š๊ฑฐ๋‚˜ tag๋ฅผ latest ๋ผ๊ณ  ์ง€์ •ํ•˜์ง€ ์•Š๋Š”๋‹ค๋ฉด, :latest ๋Š” ์˜ํ–ฅ์„ ๋ฐ›๊ฑฐ๋‚˜ ์ƒˆ๋กœ ๋งŒ๋“ค์–ด์ง€์ง€ ์•Š๋Š”๋‹ค

  • Versioning์„ ์œ„ํ•ด latest tag๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ , tag์— patch number ๋‚˜ git commit ์„ ํ™œ์šฉํ•˜๋Š” ๊ฒƒ์ด ์ข‹์€ practice ์ด๋‹ค

Last updated