Skip to content

samucodesh/Go-Docker-Test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go-Docker-Test

Description:

This project is a simple Go application that demonstrates how to build and run a Docker image. It's a great starting point for learning how to containerize Go applications.

Prerequisites:

  • Git: To clone the repository and manage version control.
  • Docker: To build and run the Docker image.

Cloning the Repository:

  1. Initialize a new local repository:
    git init
  2. Add a remote:
    git remote add origin git@github.com:samucodesh/Go-Docker-Test.git

Note

Replace git@github.com:samucodesh/Go-Docker-Test.git with your ssh link

  1. Clone the repository:
    git pull origin main

Building the Image:

Navigate to the root directory of the project and run the following command:

docker build -t mygoapp .

This will build the Docker image from the Dockerfile in the current directory and tag it as mygoapp.

Running the Image:

To run the image in a container, use the following command:

docker run -p 8080:8080 mygoapp

This will start a container from the mygoapp image and map port 8080 of the container to port 8080 of your local machine. You can access your application at http://localhost:8080.

Sponsor this project

 

Languages