Giter VIP home page Giter VIP logo

terraform-provider-dockerhub's Introduction

=======

Docker Hub Provider

registry.terraform.io

Build Status

Lifecycle management of Docker Hub using the v2 API.

This provider enables management of Docker Hub registries, groups, permissions and access tokens.

Installation

The provider can be installed and managed automatically by Terraform. Sample versions.tf file:

terraform {
  required_version = ">= 0.13"

  required_providers {
    dockerhub = {
      source  = "BarnabyShearer/dockerhub"
      version = ">= 0.0.15"
    }
  }
}

Quick Start

# Configure the Docker Hub Provider
provider "dockerhub" {
  username = "azurediamond"
  password = "hunter2"
}

# Create an organization group for developers
resource "dockerhub_group" "project-developers" {
  organisation = "organisation"
  name         = "project"
  description  = "Project developers"
}

# Create an organization group for CI
resource "dockerhub_group" "project-ci" {
  organisation = "organisation"
  name         = "ci"
  description  = "Project CI"
}

# Create an image registry
resource "dockerhub_repository" "project" {
  name             = "project"
  namespace        = "organisation"
  description      = "Project description"
}

# Associate our developers group with the registry
resource "dockerhub_repositorygroup" "project-developers" {
  repository = dockerhub_repository.project.id
  group = dockerhub_group.project-developers.group_id
  groupname = dockerhub_group.project-developers.name
  permission = "admin"
}

# Associate our CI group with the registry
resource "dockerhub_repositorygroup" "project-ci" {
  repository = dockerhub_repository.project.id
  group = dockerhub_group.project-ci.group_id
  groupname = dockerhub_group.project-ci.name
  permission = "write"
}

Development Guide

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.12+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin to your $PATH.

To compile the provider, run make terraform-provider-dockerhub. This will build the provider and put the provider binary in the local directory.

Testing

In order to test the provider, you can simply run make test.

$ make test

Installing

To install the provider locally (for instance for manually testing) run

$ make install

This installs the provider to ~/.terraform.d/, removes .terraform.lock.hcl and runs terraform init in the local folder.

Thanks

Organisation and Group support added by Magenta ApS.

terraform-provider-dockerhub's People

Contributors

barnabyshearer avatar dependabot[bot] avatar skeen avatar web-flow avatar ivankovnatsky avatar

Stargazers

Ofey Chan avatar Mário Uhrík avatar Ashley Jackson avatar Guy Barros avatar

Watchers

James Cloos avatar  avatar

terraform-provider-dockerhub's Issues

Authentication appears to be broken

I get the following error whenever I try to do anything with this provider.

Backend:

terraform {
  required_providers {
    dockerhub = {
      source = "BarnabyShearer/dockerhub"
      version = ">= 0.0.15"
    }
  }
}
╷
│ Error: Post "https://hub.docker.com/v2/users/login/": dial tcp: lookup hub.docker.com: i/o timeout

Will there be an option for 2FA

Error: {"detail":"Require secondary authentication on MFA enabled account","login_2fa_token":

It terms of security it would be very nice to have this feature available bypassed with API token.

Constant rate-limit errors

Hello, I am managing a Terraform project with about 600 resources, and I am constantly getting rate-limited. I am using a paid user which is supposed to have higher limits.

Error: {"detail": "Rate limit exceeded", "error": false}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.