Skip to content

Instantly share code, notes, and snippets.

View lukewpatterson's full-sized avatar

Luke Patterson lukewpatterson

View GitHub Profile
import groovy.json.JsonSlurper
import org.sonatype.nexus.repository.storage.Asset
import org.sonatype.nexus.repository.storage.StorageFacet
def DOCKER_REPOSITORY_NAME = 'docker-hosted'
def dockerRepository = repository.repositoryManager.get(DOCKER_REPOSITORY_NAME)
def dockerBlobStore = blobStore.blobStoreManager.get(dockerRepository.configuration.attributes.storage.blobStoreName)
def storageTx = dockerRepository.facet(StorageFacet.class).txSupplier().get()
try {
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.keyholesoftware.blog</groupId>
<artifactId>khs-docker-caching-blog</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
FROM maven:3.2.5-jdk-8u40
RUN mkdir --parents /usr/src/app
WORKDIR /usr/src/app
# selectively add the POM file
ADD pom.xml /usr/src/app/
# get all the downloads out of the way
RUN mvn verify clean --fail-never
package com.keyholesoftware.blog;
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
package com.keyholesoftware.blog;
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
package com.keyholesoftware.blog;
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
package com.keyholesoftware.blog;
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
khs-docker-caching-blog$ docker build .
Sending build context to Docker daemon 2.633 MB
Sending build context to Docker daemon
Step 0 : FROM maven:3.2.5-jdk-8u40
---> cef499116951
Step 1 : RUN mkdir --parents /usr/src/app
---> Using cache
---> 43927e63fa7d
Step 2 : WORKDIR /usr/src/app
---> Using cache
khs-docker-caching-blog$ docker build .
Sending build context to Docker daemon 2.633 MB
Sending build context to Docker daemon
Step 0 : FROM maven:3.2.5-jdk-8u40
---> cef499116951
Step 1 : RUN mkdir --parents /usr/src/app
---> Using cache
---> 43927e63fa7d
Step 2 : WORKDIR /usr/src/app
---> Using cache
{
"vars": {
"@gray-darker": "lighten(#000, 45.5%)",
"@gray-dark": "lighten(#000, 20%)",
"@gray": "lighten(#000, 33.5%)",
"@gray-light": "lighten(#000, 46.7%)",
"@gray-lighter": "lighten(#000, 93.5%)",
"@brand-primary": "#428bca",
"@brand-success": "#5cb85c",
"@brand-info": "#5bc0de",