https://github.com/Think-Cube/DockerWhoamiID
DockerWhoamiID: Docker container with a Go app to check and display container ID.
https://github.com/Think-Cube/DockerWhoamiID
containeridgo containerwhoami dockercodeid dockeridcheck dockerinspectid dockerverifyid gocontainerid idcheckergodocker whoamidockerapp whoamiindocker
Last synced: 6 months ago
JSON representation
DockerWhoamiID: Docker container with a Go app to check and display container ID.
- Host: GitHub
- URL: https://github.com/Think-Cube/DockerWhoamiID
- Owner: Think-Cube
- License: mit
- Created: 2019-04-24T12:30:14.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2025-05-22T16:12:00.000Z (about 1 year ago)
- Last Synced: 2025-05-22T17:36:46.729Z (about 1 year ago)
- Topics: containeridgo, containerwhoami, dockercodeid, dockeridcheck, dockerinspectid, dockerverifyid, gocontainerid, idcheckergodocker, whoamidockerapp, whoamiindocker
- Language: Go
- Homepage:
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DockerWhoamiID
DockerWhoamiID is a simple Go application within a Docker container designed to check and display the container ID.
## Getting Started
### Prerequisites
- Docker installed on your machine
### Build and Run
1. Clone the repository:
```bash
git clone https://github.com/Think-Cube/DockerWhoamiID.git
```
2. Build the Docker image:
```bash
docker build -t dockerwhoamiid .
```
3. Run the Docker container:
```bash
docker run -p 8000:8000 dockerwhoamiid
```
The application will be accessible at http://localhost:8000.
## Dockerfile
The Dockerfile defines the build process for the application. It uses a multi-stage build, first building the Go binary and then creating a lightweight image to run the application.
## http.go
The `http.go` file contains the Go source code for the simple application. It listens on a specified port and responds with the container's hostname.
## whoami@.service
The `whoami@.service` file is a systemd service unit for running the Docker container as a service.
## License
This project is licensed under the [MIT License](https://opensource.org/licenses/MIT).
## Contribution
Feel free to contribute by opening issues or pull requests. Your feedback and improvements are highly appreciated!