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

Enable jib again #52

Merged
merged 2 commits into from
Aug 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/fakeserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ First extract the api-key from the Docker image.

```bash
$ docker pull quay.io/infostellarinc/fake-apiserver
$ docker run -v `pwd`:/out --entrypoint extract-key -it --rm infostellarinc/fake-apiserver
$ docker run -v `pwd`:/out --entrypoint sh -it --rm quay.io/infostellarinc/fake-apiserver /extract-key
```

A file named `api-key.json` will be present in the current directory which you can use to initialize
Expand All @@ -59,7 +59,7 @@ exercises the server code.
The server can be configured in any of the following ways:

- by system properties passed on the gradle command line
- by system properties passed through the JAVA_OPTS env var on the docker command line
- by system properties passed through the JAVA_TOOL_OPTIONS env var on the docker command line
- by environment variables on the docker command line

See also [application.conf](./src/main/resources/application.conf).
Expand All @@ -77,7 +77,7 @@ is resolved. In the meantime,

```bash
$ docker login quay.io # Only need to do this once on a machine
$ ./gradlew :examples:fakeserver:dockerBuildImage
$ ./gradlew :examples:fakeserver:jibDockerBuild
$ docker run -it --rm quay.io/infostellarinc/fake-apiserver # Sanity check the server starts up
$ docker push quay.io/infostellarinc/fake-apiserver
```
32 changes: 13 additions & 19 deletions examples/fakeserver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ buildscript {
}
}

plugins {
id 'com.google.cloud.tools.jib' version '0.9.9'
}

apply plugin: 'application'
apply plugin: 'com.bmuschko.docker-java-application'

archivesBaseName = 'stellarstation-fake-apiserver'
mainClassName = 'com.stellarstation.api.fakeserver.FakeServerMain'
Expand All @@ -48,24 +51,15 @@ dependencies {
compileOnly group: 'org.immutables', name: 'value', classifier: 'annotations'
}

docker {
javaApplication {
baseImage = 'openjdk:10-jre-slim'

maintainer = 'StellarStation Team'
ports = [8080, 8081]
tag = 'quay.io/infostellarinc/fake-apiserver'
jib {
from {
image = 'gcr.io/distroless/java:debug'
}
}

dockerDistTar {
addFile 'api-key.json', '/var/keys/api-key.json'
addFile 'extract-key', '/usr/bin/extract-key'

doFirst {
copy {
from 'src/misc'
into "$buildDir/docker"
}
to {
image = 'quay.io/infostellarinc/fake-apiserver'
}
container {
mainClass = mainClassName
ports = ['8080', '8081']
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/sh

cp /var/keys/api-key.json /out
2 changes: 1 addition & 1 deletion examples/java/printing-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ dependencies {
}

processResources {
from project(':examples:fakeserver').file('src/misc/api-key.json')
from project(':examples:fakeserver').file('src/main/jib/var/keys/api-key.json')
from project(':examples:fakeserver').file('src/main/resources/tls.crt')
}