Code Monkey home page Code Monkey logo

load-to-docker's Introduction

Overview

Maven and gradle plugins to publish a docker tarball (e.g. created by jib) to the docker daemon via named pipe (Docker Windows) or unix domain socket (Linux). With this plugin you can publish your images without the need to install the docker CLI.

Usage with Maven

Example configuration in maven (including jib):

<build>
    <plugins>
        <plugin>
            <groupId>com.google.cloud.tools</groupId>
            <artifactId>jib-maven-plugin</artifactId>
            <executions>
                <execution>
                    <id>create-tar</id>
                    <phase>package</phase>
                    <goals>
                        <goal>buildTar</goal>
                    </goals>
                    <configuration>
                        <from>
                            <image>
                                amazoncorretto:17
                            </image>
                        </from>
                        <to>
                            <image>
                                my-application
                            </image>
                            <tags>
                                <tag>latest</tag>
                            </tags>
                        </to>
                        <outputPaths>
                            <tar>target/jib-image.tar</tar>
                        </outputPaths>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>com.prime157.docker</groupId>
            <artifactId>load-to-docker-maven-plugin</artifactId>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>load-to-docker</goal>
                    </goals>
                    <configuration>
                        <tarball>target/jib-image.tar</tarball>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
  • The jib plugin is configured to create a tarball of the image layers and stores it in target/jib-image.tar
  • The load-to-docker-maven-plugin is configured to push the tarball from target/jib-image.tar to docker. On Windows the plugin will talk to docker via the named pipe \\.\pipe\docker_engine. On linux via the unix domain socket /var/run/docker.sock.

Usage with Gradle

Example configuration with gradle (assuming you have configured jib to generate the image tarball in build/jib-image.tar):

plugins {
  id 'com.prime157.docker.load-to-docker' version '0.1'
}
load_to_docker {
  tarball = 'build/jib-image.tar'
}
  • The load-to-docker plugin is configured to push the tarball from build/jib-image.tar to docker. On Windows the plugin will talk to docker via the named pipe \\.\pipe\docker_engine. On linux via the unix domain socket /var/run/docker.sock.
  • The tarball can either be an absolute path or a path relative to the project's root path.
  • The task is called loadToDocker
  • The gradle plugin is only published to maven central - you will need to configure gradle to load plugins from there, e.g. in your settings.gradle you need to add mavenCentral:
pluginManagement {
  repositories {
    mavenCentral()
  }
}

load-to-docker's People

Contributors

dimovelev avatar

Stargazers

 avatar

Watchers

 avatar

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.