Sign inSign up

estebanandres/helloruby

By estebanandres

•Updated almost 2 years ago

Image
0

1.0K

estebanandres/helloruby repository overview

⁠Ruby

⁠Description

A simple Ruby application demonstrating an HTTP server that responds with "hello world."

⁠Prerequisites

Docker must be installed. You can install Docker from docker.com⁠

⁠Installation

⁠Step 1: Pull the Image

First, pull the image from Docker Hub using the following command:

docker pull estebanandres/helloruby
⁠Step 2: Run the Container

To run the container, use the following command:

 docker run -p 8087:8087 --name helloruby estebanandres/helloruby

• -p 8087:8087 maps port 8087 from the container to port 8087 on your machine. • --name helloruby assigns a name to the container for easy reference.

⁠Important

To use the previous command, port 8087 must be available. If it's in use, you can map it to another port. For example, to map to port 3000, use the following command:

docker run -p 3000:8087 --name helloruby estebanandres/helloruby
⁠Running the Container in the Background (Detached Mode)

If you want to run the container in the background, use the -d flag for detached mode:

docker run -d -p 8087:8087 --name helloruby estebanandres/helloruby

The -d flag runs the container in the background, allowing you to continue using your terminal while the container runs. You can verify that the container is running in the background by using:

docker ps

This command will show you a list of all running containers.

⁠Full Example

If you want to run the container in the background, use the -d flag for detached mode:

docker pull estebanandres/helloruby
docker run -d -p 8087:8087 --name helloruby estebanandres/helloruby


⁠Usage

Once the container is running, access the application in your browser at:

http://localhost:8087

⁠Additional Commands

⁠Stop the Container

To stop the container:

docker stop helloruby

⁠Restart the Container

To restart a stopped container:

docker start helloruby

⁠Remove the Container

To remove the container after stopping it:

docker rm helloruby

Tag summary

Content type

Image

Digest

sha256:afdfa5831…

Size

377.3 MB

Last updated

almost 2 years ago

docker pull estebanandres/helloruby