ReadMe - How to
How to deploy docker project in SAP BTP
To get this project you don't need to clone the repository just run
curl https://raw.githubusercontent.com/KeyliTestRep/ProjectOption1/main/Dockerfile -o Dockerfile
After registering on DockerHub run with your User ID/The name you want for your repository: image Nametag
docker build -t $USERID/$REPOID:$NAMETAG -f Dockerfile .
Push the Image to the Docker hub
docker push $USERID/$REPOID:$NAMETAG
After registering at SAP for free trial of BTP and loging in
from SAP BTP Cockpit go to "Go to Your Trial Account"
In "SubAccounts" click "trial"
In Overview you will see API Endpoint: in this case "https://api.cf.eu10.hana.ondemand.com" save this in case you need it later, also save "Org Name"
Go Back to "The Cockpit">"SAP Business Application Studio">"Create Dev Space"
Select the Enviroment type that you want to create and Click "Create Dev Space"
When the Dev Space Transitions from "Starting" to "Running" open it by clicking on the Name
To open a terminal go to "Terminal">"New Terminal"
Run the following command to set Endpoint for the cf
commands:
cf api https://api.cf.eu10.hana.ondemand.com
To make sure everything is in order before we push the Image run:
cf login
if you get "No org or space targeted" run the following command:
cf target -o "Org Name"(That you saved earlier)
You can check the dev spaces you have with:
cf spaces
in case there are no spaces displayed after running cf spaces
cf create-space "space name"
cf target -s "space name"
Now to Push the Docker Image to Cloud Foundry keily92/keytest:pinghttp
is the one I used/made with the Dockerfile above
cf push $HOSTNAME --docker-image $USERID/$REPOID:$NAMETAG (for Dockerimage)
after the container is loaded you will get details on how it's loaded
additionally you can check with:
cf routes