Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Refactoring - Parent Issue #453

Closed
6 tasks done
muuki88 opened this issue Jan 6, 2015 · 3 comments
Closed
6 tasks done

Docker Refactoring - Parent Issue #453

muuki88 opened this issue Jan 6, 2015 · 3 comments

Comments

@muuki88
Copy link
Contributor

muuki88 commented Jan 6, 2015

This parent issue summarizes the docker feature requests and improvement suggestions:

In order to get a better user experience, we should refactor the DockerPlugin
in a way we meet all these requirements.

@fiadliel first intention when building the plugin was to be as restrictive as possible and
build a working "out-of-the-box" solution. I still think this is a good idea and keep the
working "out-of-the-box" policy, when refactoring.

Goals

  • Working "out-of-the-box"
  • Customize every docker command

State of the Art

At this point every configuration for the dockerfile is represented by
a custom setting:

Docker Command Setting
FROM dockerBaseImage
MAINTAINER maintainer
ADD hardcoded
WORKDIR dockerBaseDirectory
RUN hardcoded
ENTRYPOINT dockerEntrypoint, executableScriptName
CMD hardcoded
EXPOSE dockerExposedPorts
VOLUME dockerExposedVolumes

Possible Solutions

There are two obvious solutions that could be implemented

Setting per Command

Continue the current implementation and provide a setting for each
docker command.

Pro Con
User can list available settings New commands must be added manually
Less error prone as every cmd is testable Too many settings

List of Docker Commands

A Dockerfile is a simple list of commands (CmdLike). We could expose
a setting TaskKey[Seq[CmdLike]] that gets filled by default. Users can remove,
add, replace commands as they like.

Pro Con
More like native Docker More complex to alter
Full customizable Untested commands may cause strange behaviour
@huntc
Copy link
Contributor

huntc commented Jan 6, 2015

Nice summary!

@muuki88
Copy link
Contributor Author

muuki88 commented Jan 6, 2015

Do you have time for hangout/skype call? It would be awesome if we could tackle
this issue together :)

@muuki88
Copy link
Contributor Author

muuki88 commented Jan 13, 2015

Call Summary

We will take a hybrid approach like sbt/sbt-rjs and provide the
important settings as sbt settings. These will all get aggregated into an single setting (e.g. dockerCommands), which is used to generate the Dockerfile.

Important points are

  1. Only commonly used docker commands will be added as sbt settings
  2. Documentation for customizing the dockerCommands setting is very important

Implementation

I don't have much time for the next, as well as @huntc .

@fiadliel do you have any suggestions/additions?

muuki88 added a commit that referenced this issue Feb 10, 2015
muuki88 added a commit that referenced this issue Feb 13, 2015
@muuki88 muuki88 closed this as completed Feb 15, 2015
metasim pushed a commit to metasim/sbt-native-packager that referenced this issue Feb 15, 2015
* master:
  Update README.md
  Replace chmod call
  More comprehensive tests
  Adding documentation
  FIX sbt#276 creating directories as necessary and specify top level dir and sadly realizing that apache commons compress is still the best bet
  Adding documentation, examples and tests.
  Initial refactoring on sbt#453
  Revert "[fix sbt#472] /etc/default/<package-name> should be shell script setting envars"
  FIX sbt#489: Small fix in documentation
  Upgrading to java 7 and using posix nio API

Conflicts:
	src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerHelper.scala
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants