Gleam package to check if we're inside a container
  • Gleam 83.2%
  • Dockerfile 16.8%
Find a file
2026-09-16 20:07:27 +02:00
.github/workflows test: add Podman smoke test 2026-09-15 10:59:12 +02:00
src feat: initial commit 2026-09-14 21:28:48 +02:00
test test: add Podman smoke test 2026-09-15 10:59:12 +02:00
.gitignore feat: initial commit 2026-09-14 21:28:48 +02:00
Dockerfile docs: update Dockerfile comment 2026-09-15 23:44:37 +02:00
gleam.toml docs: fix README, add LICENSE, update manifest 2026-09-16 20:07:27 +02:00
LICENSE docs: fix README, add LICENSE, update manifest 2026-09-16 20:07:27 +02:00
manifest.toml feat: initial commit 2026-09-14 21:28:48 +02:00
README.md docs: fix README, add LICENSE, update manifest 2026-09-16 20:07:27 +02:00

is_container

Package Version Hex Docs

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.