Sign inSign up

klud/docker-gql

By klud

•Updated almost 9 years ago

GraphQL Docker API

Image
0

2.3K

klud/docker-gql repository overview

⁠GraphQL Docker API

Source: klud/graphql-docker-api⁠

pipeline status Go Report Card Docker Pulls License

Logo

A GraphQL Server for the Docker API, written in Golang.

⁠Getting Started

⁠Docker image
⁠Local socket
docker run -d \
--name docker-gql \
-p 8080:8080 \
-e UI_ENDPOINT="/api" \
-v /var/run/docker.sock:/var/run/docker.sock \
klud/docker-gql

Note: The -v /var/run/docker.sock:/var/run/docker.sock option can be used in Linux environments only.

⁠Remote host
⁠HTTP
docker run -d \
--name docker-gql \
-p 8080:8080 \
-e UI_ENDPOINT="/api" \
-e DOCKER_HOST="http://<host>:<port>" \
klud/docker-gql
⁠HTTPS
docker run -d \
--name docker-gql \
-p 8080:8080 \
-e UI_ENDPOINT="/api" \
-e DOCKER_HOST="https://<host>:<port>" \
-v /path/to/folder/containing/the/docker/certs:/etc/docker \
klud/docker-gql

⁠Environment variables

  • DOCKER_CERT_PATH: When using safe connection to Docker Remote API.
  • DOCKER_HOST: Host the API will retrieve information from (default: "/var/run/docker.sock").
  • GQL_PORT: Port the API will listen on (default: ":8080").
  • GRAPHIQL: It's enabled by default, GRAPHIQL=0 must be set in order to disable it.
  • UI_ENDPOINT: Endpoint GraphiQL will work on (default: "/graphql").
⁠Notes
  • If using a Docker Remote API, this must be specified with the either HTTP or HTTPS protocols (e.g,: DOCKER_HOST="http://<host>:<port>").
  • When using HTTPS, the TLS certs must be placed in /etc/docker or the /path/to/folder/containing/the/docker/certs must be mounted under /etc/docker inside the running container, and must follow the semantics behind the DOCKER_CERT_PATH⁠ env var.
  • GRAPHIQL can be reached at the UI_ENDPOINT; disabling is advised when using in production.
  • If GraphiQL is disabled, UI_ENDPOINT must not be set at all.

⁠TODO

  • GraphQL Queries
    • Map to endpoints of the Docker API
      • Containers
      • Images
      • Swarm
        • Services
        • Stacks
      • System⁠
      • Volumes
      • Secrets
      • Tasks
  • GraphQL Mutations
  • GraphQL Subscriptions if possible, especially for Docker events
  • GraphQL Descriptions
  • Authentication / Authorization
  • Makefile for local build
    • Binary
    • Docker image
  • CI integration
  • Build from source how-to
  • Docker image how-to

⁠Open-Source libraries and tools


forthebadge forthebadge

Tag summary

Content type

Image

Digest

Size

1.8 MB

Last updated

almost 9 years ago

docker pull klud/docker-gql