All Projects → zalando-stups → Pierone

zalando-stups / Pierone

Licence: other
STUPS' Docker registry with S3 backend, immutable tags and SCM source tracking

Programming Languages

clojure
4091 projects

Projects that are alternatives of or similar to Pierone

Docker Registry Manifest Cleanup
Cleans up docker registry by removing untagged manifests from the registry
Stars: ✭ 127 (+122.81%)
Mutual labels:  s3, docker-registry
craneoperator
Gives you a simple web interface for browsing around a Docker Registry
Stars: ✭ 116 (+103.51%)
Mutual labels:  registry, docker-registry
Login Action
GitHub Action to login against a Docker registry
Stars: ✭ 149 (+161.4%)
Mutual labels:  registry, docker-registry
Dockerscan
Docker security analysis & hacking tools
Stars: ✭ 1,046 (+1735.09%)
Mutual labels:  registry, docker-registry
Dockercheatsheet
🐋 Docker Cheat Sheet 🐋
Stars: ✭ 3,301 (+5691.23%)
Mutual labels:  registry, docker-registry
crux.land
crux.land is a free registry service meant for hosting small (≤ 20kB) single deno scripts.
Stars: ✭ 50 (-12.28%)
Mutual labels:  registry, s3
Search Docker Registry V2 Script.1.0
view-private-registry is a simple bash script for listing images in a private registry v2, docker search registry-v2
Stars: ✭ 34 (-40.35%)
Mutual labels:  registry, docker-registry
Docker Registry Ui
The simplest and most complete UI for your private registry
Stars: ✭ 756 (+1226.32%)
Mutual labels:  registry, docker-registry
ttl.sh
An anonymous & ephemeral Docker image registry
Stars: ✭ 107 (+87.72%)
Mutual labels:  registry, docker-registry
cleanreg
A small tool to clean up Docker Registries (v2).
Stars: ✭ 48 (-15.79%)
Mutual labels:  registry, docker-registry
Registry Cli
Scripts for easy manipulation of docker-registry from command line (and from scripts)
Stars: ✭ 609 (+968.42%)
Mutual labels:  registry, docker-registry
Docker registry cli
Docker Registry CLI - Provides search functionality for Docker Registry (UI and CLI)
Stars: ✭ 48 (-15.79%)
Mutual labels:  registry, docker-registry
Regslscan
A tool for scanning registery key permissions. Find where non-admins can create symbolic links.
Stars: ✭ 39 (-31.58%)
Mutual labels:  registry
Docker Bind
Bind caching DNS server on Debian with wild-card domain support
Stars: ✭ 50 (-12.28%)
Mutual labels:  docker-registry
Aws S3 Scala
Scala client for Amazon S3
Stars: ✭ 35 (-38.6%)
Mutual labels:  s3
Aws Utilities
Docker images and scripts to deploy to AWS
Stars: ✭ 52 (-8.77%)
Mutual labels:  s3
Dkregistry Rs
A pure-Rust asynchronous library for Docker Registry API v2
Stars: ✭ 35 (-38.6%)
Mutual labels:  docker-registry
Go Containerregistry
Go library and CLIs for working with container registries
Stars: ✭ 974 (+1608.77%)
Mutual labels:  registry
S3sup
Static site uploader for Amazon S3
Stars: ✭ 34 (-40.35%)
Mutual labels:  s3
Arc
📎 Flexible file upload and attachment library for Elixir
Stars: ✭ 1,087 (+1807.02%)
Mutual labels:  s3

================================= Pier One - STUPS' Docker Registry

.. image:: https://travis-ci.org/zalando-stups/pierone.svg?branch=master :target: https://travis-ci.org/zalando-stups/pierone :alt: Travis CI build status

.. image:: https://coveralls.io/repos/zalando-stups/pierone/badge.svg :target: https://coveralls.io/r/zalando-stups/pierone :alt: Coveralls status

Docker registry with immutable tags, repo permissions, S3 backend and OAuth.

Development

The service is written in Clojure. You need Leiningen_ installed to build or develop.

To start a web server for the application, you need a running PostgreSQL instance on localhost with empty pierone database (postgres/postgres as user/pass). Run the development web server with:

.. code-block:: bash

$ lein repl
(go)

The web server will run on port 8080. You can find the Swagger UI on http://localhost:8080/ui/.

Testing with different client versions

Use docker in docker: https://hub.docker.com/r/library/docker/

For example:

# First push the image
$ docker push my-machine-hostname:8080/foo/bar:123
# Try to pull it using a specific version of docker (1.11)
# Start the daemon
$ docker run -it --privileged --name docker11 -d docker:1.11-dind --insecure-registry my-machine-hostname:8080
# Execute the command
$ docker run -it --rm --link docker11:docker docker:1.11 docker pull my-machine-hostname:8080/foo/bar:123
# ... execute more commands
# Stop the daemon
$ docker rm -fv docker11

Testing

Running unit tests with code coverage report:

.. code-block:: bash

$ lein cloverage

.. code-block:: bash

$ docker pull busybox
$ docker tag busybox localhost:8080/example/foobar:1.0
$ docker push localhost:8080/example/foobar:1.0
$ docker pull localhost:8080/example/foobar:1.0

Building

.. code-block:: bash

$ lein do uberjar, scm-source, docker build

Running

Pier One supports a number of environment variables to use the Amazon S3 backend. You will need a PostgreSQL database (database schemas are created automatically on first start).

.. code-block:: bash

# run Pier One locally with file backend and connect to localhost PostgreSQL
# NOTE: we simply use the "host" networking hack here to connect to the localhost DB
$ docker run -it -p 8080:8080 --net=host stups/pierone

DB_SUBNAME Postgres connection string, e.g "//pierone.foo.eu-west-1.rds.amazonaws.com:5432/pierone?ssl=true". Default is "//localhost:5432/pierone" DB_PASSWORD Postgres password. Default is "postgres". DB_USER Postgres user name. Default is "postgres". HTTP_ALLOW_PUBLIC_READ Allow Docker image downloads without authentication (e.g. to run Pier One as a registry for open source projects). Default is "false". HTTP_TEAM_SERVICE_URL URL to get team membership information by user's UID. HTTP_TOKENINFO_URL OAuth2 token info URL (e.g. https://example.org/oauth2/tokeninfo). You can leave away this configuration property to disable OAuth authentication. HTTP_IIDINFO_URL IID info URL for checking AWS Instance Identity Document based authorization. Only is enabled when HTTP_TOKENINFO_URL is also set. PGSSLMODE Set to "verify-full" in order to fully verify the Postgres SSL cert. STORAGE_S3_BUCKET Only for S3 backend: the Amazon S3 bucket name. NREPL_ENABLED Set to true to start NREPL server before starting the application. Default is false. NREPL_PORT Specify the port for NREPL server. Default is random port. API_SNS_REGION SNS topic region (notifications on pushed tags) API_SNS_TOPIC_ARN SNS topic arn (notifications on pushed tags)

See the STUPS Installation Guide section on Pier One_ for details about deploying Pier One into your AWS account.

.. _Leiningen: http://leiningen.org/ .. _STUPS Installation Guide section on Pier One: http://docs.stups.io/en/latest/installation/service-deployments.html#pier-one

Security

Pier One uses OAuth 2 to protect its resources. The current implementation assumes:

  • OAuth token information contains the uid field with the user's ID (e.g. "jdoe")
  • The user's team membership can be looked up in the team service
  • Authenticated users are allowed to pull all Docker images
  • Authenticated users are allowed to push to their team's repository only

As Docker CLI only supports Basic authentication, Pier One uses a special username:

.. code-block::

oauth2:OAUTH2_TOKEN_GOES_HERE

This string has to be encoded by base64 and put into ~/.docker/config.json:

.. code-block:: json

{
  "auths": {
    "pierone.example.org": {
      "email": "[email protected]",
      "auth": "BASE64_ENCODED_AUTH_STRING"
    }
  }
}

Additionally, to support image pulling from known AWS EC2 machines, Instance Identity Document (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.html) can be used to authenticate instead of OAuth2 token, it also uses a special username:

.. code-block::

instance-identity-document:MIAGCSqG ... AAAAAAA

The MIAG... string can be obtained from EC2 instance profile under http://169.254.169.254/latest/dynamic/instance-identity/pkcs7. It's not a common use case, but Pier One CLI API can be used to generate ~/.docker/config.json:

.. code-block:: bash

python3 -c "from pierone.api import docker_login_with_iid; docker_login_with_iid('pierone.example.org')"

The Pier One CLI_ allows configuring the Docker client with the appropriate auth credentials.

.. _Pier One CLI: https://github.com/zalando-stups/pierone-cli

License

Copyright © 2015 Zalando SE

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].