GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ulm0/graphql-docker-api: A GraphQL Server for the Docker API

This repository was archived by the owner on Aug 1, 2020. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

28 Commits
28 Commits

Folders and files

NameName
Last commit message
Last commit date
cmd/gdapi
cmd/gdapi
 
 
resolver
resolver
 
 
resources
resources
 
 
schema
schema
 
 
.dockerignore
.dockerignore
 
 
.gitignore
.gitignore
 
 
.gitlab-ci.yml
.gitlab-ci.yml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Dockerfile
Dockerfile
 
 
Gopkg.lock
Gopkg.lock
 
 
Gopkg.toml
Gopkg.toml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

GraphQL Docker API

pipeline status Go Report Card Docker Pulls License

Logo

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

GraphQL Schema

  • Schema files can be found here.
  • You can check the query-ready fields in the TODO list

Note: It's important to keep this schema synced with the types implemented in the wrapper, best efforts are made in order to keep it so. That being said, You need to know this schema is subject to change as the time goes by and new changes are introduced in the Docker API and this wrapper as well.

Getting Started

Building from source

  • Get the package: go get -d gitlab.com/ulm0/graphql-docker-api/cmd/gdapi
  • Dependencies
    • Not using dep. Go to the project folder with cd $GOPATH/src/gitlab.com/ulm0/graphql-docker-api/cmd/gdapi and go get -d ./, this will download the depedencies needed, once that's done build the package with go build.
    • Using dep. Go to the project folder with cd $GOPATH/src/gitlab.com/ulm0/graphql-docker-api, and run dep ensure, now get to $GOPATH/src/gitlab.com/ulm0/graphql-docker-api/cmd/gdapi and build the package with go build.

That's pretty much it. Congrats You have GraphQL Docker API on your system now.

Docker image

Local socket

docker run -d \
--name docker-gql \
-p 8080:8080 \
-e API_ENDPOINT="/api" \
-v /var/run/docker.sock:/var/run/docker.sock \
ulm0/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 API_ENDPOINT="/api" \
-e DOCKER_HOST="http://<host>:<port>" \
ulm0/docker-gql
HTTPS
docker run -d \
--name docker-gql \
-p 8080:8080 \
-e API_ENDPOINT="/api" \
-e DOCKER_HOST="https://<host>:<port>" \
-v /path/to/folder/containing/the/docker/certs:/etc/docker \
ulm0/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.
  • API_ENDPOINT: Endpoint for the API (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 API_ENDPOINT; disabling is advised when using in production, you can do so by setting GRAPHIQL=0.

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
    • Multiarch support using manifest-tool

Open-Source libraries and tools

  • docker/client
  • golang/dep
  • gorilla/mux
  • neelance/graphql-go
  • urfave/negroni

forthebadge forthebadge

About

A GraphQL Server for the Docker API

gitlab.com/ulm0/graphql-docker-api

Topics

dockerdocker-apidocker-imagegolanggraphqlgraphql-serverschemawrapper

Resources

Readme
MIT license

Contributing

Contributing
Activity

Stars

57 stars

Watchers

1 watching

Forks

5 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.