sajad torkamani

Create a Dockerfile

Create a Dockerfile to specify your app’s dependencies and the

# Use the official Ruby image from the DockerHub
CMD ["ruby", "./your_script.rb"]
FROM ruby:3.2-slim

# Set the working directory in Docker
WORKDIR /app

# Copy the content of the local src directory to the working directory
COPY . .

# Specify the command to run on container start
CMD ["ruby", "./hello-docker.rb"]

Create image from Dockerfile

docker build -t hello-world-ruby .

Start container from image

docker run hello-world-ruby
Tagged: Docker

Leave a comment

Your email address will not be published. Required fields are marked *