Pivotal Knowledge Base

Follow

How to check if an app is a docker image

Environment

Product Version
Pivotal Cloud Foundry® (PCF) 1.7.x, 1.8.x, 1.9.x

Purpose

This article discusses how to check if an app is a docker image or PCF standard image. 

Procedure

Run cf curl /v2/apps/<APP GUID> against the app and inspecting the docker_image attribute as not null. 

$ cf app lattice-app
Showing health and status for app lattice-app in org xxx / space xxx as xxx...
OK

requested state: started
instances: 0/1
usage: 1G x 1 instances
urls: xxx
last uploaded: Wed Jan 25 15:37:43 UTC 2017
stack: cflinuxfs2
buildpack: unknown

$ cf app --guid lattice-app
0349231d-9fd7-4480-90de-0d2bc98b3018

$ cf curl /v2/apps/0349231d-9fd7-4480-90de-0d2bc98b3018
(output trimmed)
{
"metadata": {
"guid": "0349231d-9fd7-4480-90de-0d2bc98b3018",
"url": "/v2/apps/0349231d-9fd7-4480-90de-0d2bc98b3018",
"created_at": "2017-01-25T15:37:43Z",
"updated_at": "2017-01-25T15:37:52Z"
},
"entity": {
"name": "lattice-app",
"buildpack": null,
"detected_buildpack": null,
"detected_buildpack_guid": null,
"docker_image": "cloudfoundry/lattice-app:latest",
}
}

While for a standard PCF image, the docker_image attribute has a null value. 

$ cf curl /v2/apps/8336404e-2dd7-4752-815b-632aea7ea0dd
(output trimmed)
{
"metadata": {
"guid": "8336404e-2dd7-4752-815b-632aea7ea0dd",
"url": "/v2/apps/8336404e-2dd7-4752-815b-632aea7ea0dd",
"created_at": "2016-10-27T18:36:58Z",
"updated_at": "2017-02-06T06:03:45Z"
},
"entity": {
"name": "cook",
"production": false,
"space_guid": "95e6db80-8efd-4d81-90ac-32abef015edf",
"stack_guid": "8f860b60-7282-473f-8e2f-f1beb11a5d58",
"buildpack": null,
"detected_buildpack": "java-buildpack=v3.10-offline-https://github.com/cloudfoundry/java-buildpack.git#193d6b7 java-main open-jdk-like-jre=1.8.0_111 open-jdk-like-memory-calculator=2.0.2_RELEASE spring-auto-reconfiguration=1.10.0_RELEASE",
"detected_buildpack_guid": "4571dcae-e3c4-410b-bd61-207b418beff1",
"docker_image": null,
},
}

 

Comments

Powered by Zendesk