An open API service indexing awesome lists of open source software.

https://github.com/forge/docker-addon

A Docker addon for JBoss Forge 2.x
https://github.com/forge/docker-addon

Last synced: about 1 year ago
JSON representation

A Docker addon for JBoss Forge 2.x

Awesome Lists containing this project

README

          

### Docker Addon for JBoss Forge 2.
:idprefix: id_

image:https://travis-ci.org/forge/docker-addon.svg?branch=master["Build Status", link="https://travis-ci.org/forge/docker-addon"]

The *Docker Addon* provides support for Docker technologies in Forge projects.This addon *exports services* for use in other addons.

=== Installation

From Forge CLI:

[source,shell]
----
addon-install-from-git --url https://github.com/forge/docker-addon.git
----

== Features
* *Dockerfile Linter*: A rule based 'linter' for https://docs.docker.com/reference/builder/[Dockerfiles] .The linter rules can be used to check file syntax as well as arbitrary semantic and best practice attributes determined by the rule file writer.
Rule files are written in YAML. The rules are implemented using regular expressions, run on one instruction of the Dockerfile at a time. Inspiration for the linter has been taken from https://github.com/projectatomic/dockerfile_lint[dockerfile_lint].

* *Dockerfile Lint command*:
Just type the following command if you're in shell.It will run the Dockerfile linter on the input Dockerfile using the Rulefile.
+
[source,shell]
----
dockerfile-lint —-dockerfile [Dockerfile] —-rulefile [Rulefile]
----
+

* *DockerfileResource for Dockerfiles*:
The Docker Addon has to provide APIs and services for interacting with real and virtual Dockerfile Resources, typically for the purpose of reading and manipulating Dockerfiles.
The addon uses https://github.com/shrinkwrap/descriptors-docker[Shrinkwrap Descriptors Docker], that provide reading,parsing,manipulating
and writing Dockerfile commands to real and virtual Dockerfile resources provided by the addon.
+
[source,java]
----
@Inject private ResourceFactory factory;
DockerFileResource resource = factory.createResource(new File(“Dockerfile”)).reify(DockerFileResource.class);
DockerDescriptor resourceDescriptor = resource.getDockerDescriptor();
----
+
* *Facets implementation*:
Docker addon adds a `DockerFacet` which is entry point for Docker addon API.

* *Dockerfile Create Command*:
This command prepares the project for functioning in Docker context.
+
[source,shell]
----
dockerfile-create
----
+
It installs the `DockerFacet` in your new project.

* *Dockerfile Setup Command*:
This command builds and packages your project and then generates the corresponding Dockerfile for deployment to docker containers.
+
[source,shell]
----
dockerfile-setup
----
+
Sample Dockerfile Format created by this command:
+
[source,text]
----
FROM jboss/wildfly
ADD target/your-awesome-app.war /opt/jboss/wildfly/standalone/deployments/
----
+

The Dockerfile generated deploys your app to a JBoss Wildfly Container.
+
* *Docker Command support over the Forge CLI*: DockerCommand supports running Docker CLI commands on the Forge CLI.
+
Eg: "docker images" command shows your Docker images on the Forge CLI just as it works on a usual CLI.
+
You can run your regular Docker commands like "docker ps" now on the Forge CLI.