Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build dockerfile

Tags:

docker

I have made images ubuntu 14:04 on dockerfile

I am running the syntax

  $ sudo docker build -t mypostgres .

but I am still confused as to build the dockerfile how to build it?

like image 511
Yuday Avatar asked Dec 01 '15 03:12

Yuday


People also ask

What is Dockerfile build file?

A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image. Using docker build users can create an automated build that executes several command-line instructions in succession.


1 Answers

sudo docker build -t mypostgres . means:

  • process the file named 'Dockerfile' (default name)
  • located in the current folder (that is the final .)
  • and build as a result the image named mypostgres

So if you have a Dockerfile starting with FROM postgres, you can execute your command and have your own postgres image in no time.

like image 186
VonC Avatar answered Oct 16 '22 10:10

VonC