env variable
export SPRING_PROFILES_ACTIVE=ololo
bash build/libs/app-0.0.1.jar
run args
export RUN_ARGS="--spring.profiles.active=trololo"
bash build/libs/app-0.0.1.jar
script parameter
bash build/libs/app-0.0.1.jar --spring.profiles.active=trololo
push
bash gradlew clean build
docker build --rm -t daggerok/openshift-spring-boot-app .
docker tag daggerok/openshift-spring-boot-app daggerok/openshift-spring-boot-app:latest
docker tag daggerok/openshift-spring-boot-app:latest daggerok/openshift-spring-boot-app:v1
docker push daggerok/openshift-spring-boot-app:v1
docker push daggerok/openshift-spring-boot-app:latest
build and run
bash gradlew clean build
docker build -t daggerok/openshift-spring-boot-app .
docker run -p 8080:8080 daggerok/openshift-spring-boot-app
docker rm -f -v $(docker ps -a|grep -v CONTAINER|awk '{print $1}')
bootstrap local development cluster
oc cluster up
...
Starting OpenShift using openshift/origin:v3.6.0 ...
OpenShift server started.
The server is accessible via web console at:
https://127.0.0.1:8443
You are logged in as:
User: developer
Password: <any value>
To login as administrator:
oc login -u system:admin
open console
open https://127.0.0.1:8443
create app from docker image
when pod will be ready create a route. for me it’s:
http http://openshift-spring-boot-ap-app.127.0.0.1.nip.io/message/message
HTTP/1.1 200
Cache-control: private
Content-Type: application/json;charset=UTF-8
Date: Fri, 15 Sep 2017 01:28:42 GMT
Set-Cookie: a24c4650d0385710537546a6e4c39846=4e67cf5991f232f6962f93f136f02575; path=/; HttpOnly
Transfer-Encoding: chunked
{
"message": "ololo"
}
-- Checking Docker daemon configuration ... FAIL
Error: did not detect an --insecure-registry argument on the Docker daemon
Solution:
Ensure that the Docker daemon is running with the following argument:
--insecure-registry 172.30.0.0/16
You can run this command with --create-machine to create a machine with the
right argument.
go to Docker → Preferences… → Daemon → insecure registries → add: 172.30.0.0/16 → Apply & Restart
now you can use command:
oc cluster up
-- Starting OpenShift container ... FAIL
Error: exec: "socat": executable file not found in $PATH
brew install openshift-cli
...
read some: