V
V
VicTHOR2021-05-12 17:08:52
Docker
VicTHOR, 2021-05-12 17:08:52

How to change image version dynamically?

Is it possible to set an image tag in .enva file and pass it to a Dockerfile?
I'm thinking of doing it via docker-compose arguments

# docker-compose
version: '3.5'
services:
  foo:
    build:
      context: .
      args:
        label: ${FOO_TAG}

# dockerfile
FROM foo:${label}

But I found out that the arguments are passed to RUN and that's not how it works.. Is there any other way to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2021-05-12
@VicTHOR

Before FROM we write ARG FOO_TAG

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question