Code Monkey home page Code Monkey logo

training-2023-12-docker-php's Introduction

Docker Hello World with PHP

This is a typical Hello World for PHP in Docker.

Table of Content

Usage

git clone https://github.com/cleaniquecoders/docker-php-hello-world

Build the Image

Then navigate to directory and build the image:

cd docker-php-hello-world/
docker docker build -t hello-world .

t argument used for tagging the image. . is the current directory build the image.

Run the Container

Typically we can run in two approach:

Running the Container in Foreground

Now run the container:

docker run -it -p 80:80 hello-world

p argument used for map exposed port in Docker container to the Host machine. it argument used for output of the container is forwarded to our terminal.

Navigate to your browser now at localhost.

Running the Container in Background

You may want to run Docker in background:

docker run -d -p 80:80 hello-world

Listing All the Running Containers

docker ps

Will output the following:

CONTAINER ID   IMAGE                                                 COMMAND                  CREATED          STATUS                PORTS                                                            NAMES
1a77e445027b   hello-world                                           "docker-php-entrypoi…"   56 seconds ago   Up 55 seconds         0.0.0.0:80->80/tcp                                               angry_taussig

Stopping the containers

docker stop <container-id/name>

training-2023-12-docker-php's People

Contributors

nasrulhazim avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.