Giter Club home page Giter Club logo

docker-template's Introduction

Docker Template

Build

Docker Template is an organization and templating system for Docker images. A way to make your life easier and more organized by having repositories within repositories that share data among multiple sets of images. It is currently used to build all the images for Jekyll and EnvyGeeks. Please see https://github.com/envygeeks/docker-template/wiki for documentation.

docker-template's People

Contributors

envygeeks avatar olleolleolle avatar rflbianco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

docker-template's Issues

Add support for TTY so that users can get more advanced output if they wish.

Add support for TTY because Non-GNU wget does not support removing only the progress bar, so it is enabled, it would be nice if non-build server builds could display that as a progression like it's intended since non-GNU wget again does not detect TTY and disable it.

tty: true
docker-template template --tty

Where --tty overrides everything and tty:true is true unless --no-tty is set.

Move push off of build and onto it's own.

This will simplify what we have to do with @repo.buildable?, slightly perf our build and make life generally easier to manage now that we have setup and teardown.

Drop #normal?, #scratch? and #rootfs?

These inhibit the ability for people to build other types of custom builders that do all sorts of nice things, remove these methods entirely along with image types and simply implement Builder#matches? so that builders can determine whether they will be the builder.

Aliased metadata should be treated as a normal build.

When metadata is aliased in some way and has it's own scopable values it should be treated as a normal build rather than an aliased build that aliases a tag, it is simply just aliasing values within a build and should be treated as a normal build.

Undefined method while building template (w/--sync-only)

In relation to envygeeks/jekyll-docker#90 and its missing rsync-package, I thought I'd post the bug here so that we could perhaps get it added sooner rather than later. :)

/home/thor/.bundler/ruby/2.3.0/docker-template-5bda91ef4e31/lib/docker/template/metadata.rb:441:in `method_missing': undefined method `as_hash' for #<Docker::Template::Metadata:0x00000002d97f40> (NoMethodError)
    from (erb):4:in `_binding'
    from /usr/lib/ruby/2.3.0/erb.rb:864:in `eval'
    from /usr/lib/ruby/2.3.0/erb.rb:864:in `result'
    from /home/thor/.bundler/ruby/2.3.0/docker-template-5bda91ef4e31/lib/docker/template/normal.rb:35:in `copy_dockerfile'
    from /home/thor/.bundler/ruby/2.3.0/docker-template-5bda91ef4e31/lib/docker/template/normal.rb:23:in `setup_context'
    from /home/thor/.bundler/ruby/2.3.0/docker-template-5bda91ef4e31/lib/docker/template/builder.rb:194:in `block in setup'
    from /home/thor/.bundler/ruby/2.3.0/docker-template-5bda91ef4e31/lib/docker/template/builder.rb:192:in `map'
    from /home/thor/.bundler/ruby/2.3.0/docker-template-5bda91ef4e31/lib/docker/template/builder.rb:192:in `setup'
    from /home/thor/.bundler/ruby/2.3.0/docker-template-5bda91ef4e31/lib/docker/template/builder.rb:127:in `build'
    from /usr/lib/ruby/2.3.0/set.rb:306:in `each_key'
    from /usr/lib/ruby/2.3.0/set.rb:306:in `each'
    from /home/thor/.bundler/ruby/2.3.0/docker-template-5bda91ef4e31/lib/docker/template/cli.rb:24:in `map'
    from /home/thor/.bundler/ruby/2.3.0/docker-template-5bda91ef4e31/lib/docker/template/cli.rb:24:in `block in build'
    from /home/thor/.bundler/ruby/2.3.0/docker-template-5bda91ef4e31/lib/docker/template/cli.rb:86:in `with_profiling'
    from /home/thor/.bundler/ruby/2.3.0/docker-template-5bda91ef4e31/lib/docker/template/cli.rb:23:in `build'
    from /usr/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /usr/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /usr/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /home/thor/.bundler/ruby/2.3.0/docker-template-5bda91ef4e31/bin/docker-template:25:in `<top (required)>'
    from /usr/lib/ruby/gems/2.3.0/bin/docker-template:23:in `load'
    from /usr/lib/ruby/gems/2.3.0/bin/docker-template:23:in `<main>'

Buildx/Multi-Arch Support

Request

I'm not sure if this is already supported but it'd be awesome to use docker-template to build for multiple architectures. Perhaps using something like the Docker buildx plugin would be best.

I'm not a Ruby user at all and only discovered docker-template today when attempting to build jekyll's Docker image on my M1 Macbook, but if I could use docker-template to build cross-architecture builds I would absolutely use docker-template for my personal projects.

Examples

Something like this would be really awesome:

docker-template buildx --platform linux/amd64,linux/arm64,linux/armhf ...

Anyway, not sure if this is all that feasible but if it was possible it would probably make things easier for users of docker-template to be able to deploy for more than one platform (unless it's already possible and I just missed it in the documentation).

Thanks for a super cool tool and any time spent looking at this request!

Release 0.9.0

Hi! We have started using docker-template to manage various of our base images. It has been quite annoying to use bundler to install it (pointing to master). Specially because we need to instruct users not versed on Ruby. It would be great to have 0.9.0 released with the current code (master) on rubygems, so we would rather use 'gem install docker-template' system-wide.

Thanks! And congrats for your work.

Failed running with Ruby 3.x

  • I tried updating to the latest version
    • I can't, there is an issue
    • This is about an < latest
      • I understand older versions may be unsupported
  • I Am on Windows
    • Ubuntu Bash on Windows
    • Fedora Bash on Windows
    • Other Bash on Windows
  • I Am on Linux
    • Ubuntu
    • Fedora
    • CentOS
    • Redhat
    • Debian
  • I am on macOS 10.13
  • I am on macOS 10.14
  • I'm on Docker
    • I understand Docker may be unsupported

Description

The following Docker container (which in essence should be similar to a fresh Debian install with Ruby 3.x installed):

FROM ruby:3.2
RUN gem install docker-template

Produces the following output when running docker-template --help inside of it:

$ docker-template --help
/usr/local/bundle/gems/forwardable-extended-2.6.0/lib/forwardable/extended.rb:29:in `rb_delegate': wrong number of arguments (given 2, expected 1) (ArgumentError)
	from /usr/local/bundle/gems/extras-0.3.0/lib/extras/string.rb:12:in `<module:String>'
	from /usr/local/bundle/gems/extras-0.3.0/lib/extras/string.rb:10:in `<module:Extras>'
	from /usr/local/bundle/gems/extras-0.3.0/lib/extras/string.rb:9:in `<top (required)>'
	from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /usr/local/bundle/gems/extras-0.3.0/lib/extras/all.rb:8:in `block in <top (required)>'
	from /usr/local/bundle/gems/extras-0.3.0/lib/extras/all.rb:7:in `each'
	from /usr/local/bundle/gems/extras-0.3.0/lib/extras/all.rb:7:in `<top (required)>'
	from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /usr/local/bundle/gems/docker-template-0.22.0/lib/docker/template.rb:6:in `<top (required)>'
	from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /usr/local/bundle/gems/docker-template-0.22.0/lib/docker/template/cli.rb:5:in `<top (required)>'
	from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /usr/local/bundle/gems/docker-template-0.22.0/bin/docker-template:25:in `<top (required)>'
	from /usr/local/bundle/bin/docker-template:25:in `load'
	from /usr/local/bundle/bin/docker-template:25:in `<main>'

Same container running with Ruby 2.x (particularly 2.7) runs as expected:

$ docker-template --help
Commands:
  docker-template build [REPOS [OPTS]]  # Build all (or some) of your reposit...
  docker-template cache [REPOS [OPTS]]  # Cache all (or some) of your reposit...
  docker-template clean [REPOS [OPTS]]  # Clean all (or some) of your reposit...
  docker-template help [COMMAND]        # Describe available commands or one ...
  docker-template list [OPTS]           # List all possible builds.
  docker-template push [REPOS [OPTS]]   # Push all (or some) of your reposito...

Maybe set required Ruby version >= 2.1.0, < 3?

Make use of Metadata#method_missing throughout.

There is no reason for us to continue to use Metadata#[] when we can use the methods and allow some kind of fallback + queryables on actual variables we rely on, so you can have truly dynamic and shifting configurations.

Start using symbols instead of strings.

Since we now support indifferent access, lets take advantage of symbols so the source is a tiny bit cleaner, this will provide no performance boost but it surely will make the code a little easier to read.

Move "tag" => { "tag" => "type" } to group to reduce confusion

Right now we have the concept of build types, which are simply called and labeled "type" in the opts.yml but we also have the concept of tag types. This can lead to confusion, rename tag types to tag groups since that's pretty much what they are and move type to build_type so further reduce the surface of confusion.

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.