Git Product home page Git Product logo

harbor's Introduction

Harbor

Description

Harbor is a wrapper for running commands and downloading file dependencies (currently only from AWS S3) before Docker image building.

Using Harbor should be simple and Harbor should help to stop usage of customized scripts run before a docker build.

Objectives

At the time, Harbor main objectives are:

  • Manage and download configuration files that don't belong in code repositories.
  • Manage per environment configuration such as: downloading different files for dev, test or production environments.
  • Execute shell commands before a docker build run (such as running some ant or maven build).
  • Execute docker build, docker tag and docker push to repository

Usage

Harbor looks up a file named harbor.yml in the same directory where run from, harbor.yml structure is:

 imagetag: <tag to be used on 'docker build'>
 tags:
   - <YAML array of custom tags to create and push into registry>
 downloadpath: <local root path to download files into>
 s3:
   bucket: <base bucket to download files from>
   basepath: <inside the bucket the root path for files to be downloaded>
 files:
   - s3path: <path to file in S3 after [s3.bucket]/[s3.basepath]>
     filename: <local path + name of the file, will be downloaded into [downloadpath]/[localname]>
     permission: <[optional] file permissions, default 0644>
 commands:
   - <YAML array containing shell commands (currently /bin/bash) to be run before 'docker build'>

 You can use ${<KEY>} as a placeholder in harbor.yml to be replaced by the value passed in a -e flag

Usage:
  harbor -h | --help
  harbor --version
  harbor --list-variables
  harbor [-e KEY=VALUE]... [options]
  harbor [options]

Options:
  -h, --help                    Show this screen.
  -v, --version                 Show version.
  --list-variables              Parses harbor.yml and prints out every ${KEY} found.
  -e KEY=VALUE                  Replaces every ${KEY} in harbor.yml with VALUE
  --debug                       Dry-run and print command executions.
  --no-download                 Prevents downloading files from S3.
  --no-commands                 Prevents commands in harbor.yml from being run.
  --no-docker                   Do not run 'docker build', 'docker tag' and 'docker push' commands.
  --no-docker-push              Do not run 'docker push' after building and tagging images.
  --docker-opts=<DOCKER_OPTS>   Will be appended to the base docker command (ex.: 'docker <docker-opts> command').
  --no-latest-tag               Do not build image tagging as 'latest',
                                will use the first tag in 'tags' list from harbor.yml or
                                generate a timestamped tag if no 'tags' list exists.

Templating in harbor.yml

You can use ${} as a placeholder in harbor.yml to be replaced by the value passed in a -e flag

harbor's People

Contributors

victorcampos avatar

Stargazers

锟斤拷 avatar Chuck Lu avatar Jun avatar footearth avatar Felix Erkinger avatar

Watchers

Alexandre Gama avatar James Cloos avatar Chuck Lu avatar  avatar  avatar

harbor's Issues

Check AWS keys in environment variables on execution

Currently harbor uses the goaws package to provide access to S3, it relies on goaws checking environment variables presence but goaws's errors are confusing as they check each env var (for access key and secret key) separately and output an error listing 2 different available env vars for each key.

It should be improved so harbor itself checks for the availability of the env vars and relies on a single canonical variable so its presence checking are simpler and the error message more helpful.

Opções para Tags

No harbor.yml:
tags: ["V1", "versionName"]

  • Seria bom versionar, porque images que dependem de outras podem se fixar a determinadas imagens.

How to solve this error ?

`[root@aliyun Deploy]# docker-compose kill
Killing deploy_ui_1 ...

ERROR: for deploy_ui_1 UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)
Traceback (most recent call last):
File "/usr/bin/docker-compose", line 9, in
load_entry_point('docker-compose==1.8.0', 'console_scripts', 'docker-compose')()
File "/usr/lib/python2.7/site-packages/compose/cli/main.py", line 61, in main
command()
File "/usr/lib/python2.7/site-packages/compose/cli/main.py", line 113, in perform_command
handler(command, command_options)
File "/usr/lib64/python2.7/contextlib.py", line 35, in exit
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.7/site-packages/compose/cli/errors.py", line 56, in handle_connection_errors
log_timeout_error()
TypeError: log_timeout_error() takes exactly 1 argument (0 given)`

latest tag

não forçar a criação da tag de latest ao buildar e pushar a imagem.

Force Tags

Adicionar opção para tag com flag -f.

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.