Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fabrizziob/basic-dockerfile
test
https://github.com/fabrizziob/basic-dockerfile
Last synced: 16 days ago
JSON representation
test
- Host: GitHub
- URL: https://github.com/fabrizziob/basic-dockerfile
- Owner: FabrizzioB
- Created: 2024-11-26T14:11:44.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-07T12:21:59.000Z (20 days ago)
- Last Synced: 2024-12-07T13:22:31.815Z (20 days ago)
- Language: Dockerfile
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# basic-dockerfile
https://roadmap.sh/projects/basic-dockerfile
### Introduction
In this project, you will write a basic Dockerfile to create a Docker image. When this Docker image is run, it should print “Hello, Captain!” to the console before exiting.
### Requirements
The Dockerfile should be named Dockerfile.
The Dockerfile should be in the root directory of the project.
The base image should be alpine:latest.
The Dockerfile should contain a single instruction to print “Hello, Captain!” to the console before exiting.
You can learn more about writing a Dockerfile here.#### Others
If you are looking to build a more advanced version of this project, you can consider adding the ability to pass your name to the Docker image as an argument, and have the Docker image print “Hello, [your name]!” instead of “Hello, Captain!”.### How to run / execute
#### 1. Build image
```bash
docker build -t basic-dockerfile .
```##### 2a. Printing with variable
```bash
docker run -e NAME="[Pretended name]" basic-dockerfile
```##### 2b. Printing without variable
```bash
docker run basic-dockerfile
```