This repository contains demos of Ubuntu OpenJDK-based ROCK containers.
- demos/rockcraft demonstrate using rockcraft to build and deploy a Java application.
- demos/java-rockcraft-plugins demonstrate Gradle rockcraft plugin.
- demos/ubuntu-jre demonstrate deploying Java application using ubuntu/jre image.
Try building the rock images for Java applications
The steps below describe installing all the prerequisites to run samples on the Ubuntu system.
Those samples require rockcraft features not yet merged into main. Please install rockcraft from this branch:
snap install snapcraft
git clone -b experimental-java https://github.com/vpa1977/rockcraft
cd rockcraft
# ensure that the installed version of rockcraft is removed
snap remove rockcraft
snapcraft
snap install --dangerous --classic *.snap
git clone https://github.com/rockcrafters/java-rockcraft-plugins
cd java-rockcraft-plugins
./gradew publishToMavenLocal
Add the local maven repository in the init script:
cat << EOF > ~/.gradle/init.d/rockcraft-plugin.gradle.kts
beforeSettings {
pluginManagement {
repositories {
gradlePluginPortal()
maven {
url = uri(System.getProperty("user.home") + "/.m2/repository")
}
}
}
}
EOF
sudo snap install docker
sudo addgroup --system docker
sudo adduser $USER docker
newgrp docker
sudo snap disable docker
sudo snap enable docker
or
sudo apt install docker.io