Sign inSign up

unshul/hello-world-app

By unshul

•Updated over 2 years ago

Just a normal hello world app from python

Image
Languages & frameworks
0

176

unshul/hello-world-app repository overview

Hello World Python Docker Image

Description: This Docker repository contains a basic "Hello World" Python application packaged into a Docker image. It demonstrates a simple setup to run a Python script within a Docker container.

Repository Structure:

  1. Dockerfile: This file defines the steps to build the Docker image. It includes instructions to set up the environment, copy the Python script, and specify the command to run when the container starts.

    FROM python:3.9-slim
    
    # Set working directory
    WORKDIR /app
    
    # Copy the Python script into the container
    COPY hello.py .
    
    # Define the command to run the script
    CMD ["python", "hello.py"]
    
  2. hello.py: This is a simple Python script that prints "Hello, World!" to the console.

    # hello.py
    print("Hello, World!")
    

Usage:

  1. Building the Docker Image:

    • Navigate to the directory containing the Dockerfile and hello.py.
    • Run the following command to build the Docker image:
      docker build -t hello-python .
      
  2. Running the Docker Container:

    • After the image is built, you can run a container based on this image using:
      docker run hello-python
      

Additional Notes:

  • This repository serves as a minimal example to demonstrate Dockerizing a Python application.
  • You can extend this setup by adding more complex Python scripts or incorporating additional dependencies into the Docker image.

Contributions: Contributions to improve the clarity, efficiency, or functionality of this repository are welcome. Feel free to submit pull requests or open issues for discussion.

Tag summary

Content type

Image

Digest

sha256:06622767a…

Size

45.5 MB

Last updated

over 2 years ago

docker pull unshul/hello-world-app