0

I have my dockerfile that contains a base image and a composer to install and I need to create a makefile for installing the existing dockerfile and I have no idea how can I create it

Sammitch
  • 30,782
  • 7
  • 50
  • 77
Sella
  • 51
  • 5
  • 1
    Containerfiles cannot be "*installed*". Do you mean "build a container-image from the containerfile"? – Turing85 Apr 26 '22 at 17:51
  • 1
    yes I need to build my image from dockerfile using makefile, when I launch make install I need dockerfile to be built – Sella Apr 26 '22 at 18:03

1 Answers1

0

You can start with a basic Makefile such as:

IMAGENAME=my-image

.PHONY: build all


.DEFAULT_GOAL := all

build:
        @docker build -t ${IMAGENAME} .

all: build

Read this article for more information, and to understand what .PHONY means read this answer.

Ortomala Lokni
  • 56,620
  • 24
  • 188
  • 240