mirror of
https://github.com/crowlabs-hq/is_container.git
synced 2026-10-23 16:36:29 +02:00
Gleam package to check if we're inside a container
- Gleam 83.2%
- Dockerfile 16.8%
|
|
||
|---|---|---|
| .github/workflows | ||
| src | ||
| test | ||
| .gitignore | ||
| Dockerfile | ||
| gleam.toml | ||
| LICENSE | ||
| manifest.toml | ||
| README.md | ||
is_container
This package allows you to know whether you're running inside a container.
gleam add is_container
import gleam/io
import is_container.{is_docker, is_container}
pub fn main() -> Nil {
case is_docker() {
True -> io.println("Running inside Docker")
False ->
case is_container() {
True -> io.println("Running inside a container (Podman/LXC)")
False -> io.println("Not running inside a container")
}
}
}
Further documentation can be found at https://is-container.hexdocs.pm/.
License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.