Skip to content

forge/docker-addon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Addon for JBoss Forge 2.

Build Status

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

Installation

From Forge CLI:

addon-install-from-git --url https://github.com/forge/docker-addon.git

Features

  • Dockerfile Linter: A rule based 'linter' for 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 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.

    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 Shrinkwrap Descriptors Docker, that provide reading,parsing,manipulating and writing Dockerfile commands to real and virtual Dockerfile resources provided by the addon.

    @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.

    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.

    dockerfile-setup

    Sample Dockerfile Format created by this command:

    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.