PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, October 18, 2022

[FIXED] how to write a dockerfile and build a docker image?

 October 18, 2022     docker     No comments   

Issue

How to write a dockerfile and build a dockerimage. i would be grateful for a step by step instructions and illustrations if possible. i am new to usage of docker and we are using on linux platform.


Solution

  1. First you have to install and configure docker in your local machine

  2. Make directory for store docker file

    mkdir docker-test cd docker-test

  3. Create docker file in your repository

    nano Dockerfile

  4. Add follow line to Dockerfile

    FROM docker/whalesay:latest RUN apt-get -y update && apt-get install -y fortunes CMD /usr/games/fortune -a | cowsay

  5. Build docker file run follow command

docker build -t docker-whale .

If you want to further details about build process read full article here.

If you have any problem please comment.



Answered By - Niroshan Ranapathi
Answer Checked By - Katrina (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing