Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1356460 - oc import can't find image from both json config and external repository
Summary: oc import can't find image from both json config and external repository
Alias: None
Product: OKD
Classification: Red Hat
Component: Command Line Interface
Version: 3.x
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Clayton Coleman
QA Contact: Xingxing Xia
Depends On:
TreeView+ depends on / blocked
Reported: 2016-07-14 07:48 UTC by XiaochuanWang
Modified: 2016-11-01 14:05 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2016-11-01 14:05:57 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description XiaochuanWang 2016-07-14 07:48:26 UTC
Description of problem:
Convert valid yml which could use to import app to json, it failed to import app by oc import app.json

Version-Release number of selected component (if applicable):
oc v1.3.0-alpha.2+2b8ea77
kubernetes v1.3.0+57fb9ac

How reproducible:

Steps to Reproduce:
1. Git clone
2. Cd docker-compose-nodejs-examples/05-nginx-express-redis-nodemon
3. Convert docker-compose.yml to json
# cat app.json 
  "web": {
    "volumes": [
    "command": "nodemon -L app/bin/www", 
    "build": "./app", 
    "links": [
    "ports": [
  "db": {
    "image": "redis"
  "nginx": {
    "build": "./nginx/", 
    "links": [
    "volumes_from": [
    "volumes": [
    "ports": [
    "restart": "always"

4. # oc import app.json -f app.json 
error: Docker image required: provide an --image flag or 'image' key in app.json

5. Try again with a simple app.json {   "db": {     "image": "redis"   } }
# oc import app.json -f redis.json 
error: Docker image required: provide an --image flag or 'image' key in app.json

# oc import app.json -f redis.json  --image=centos
error: can't build "redis.json": cannot obtain remote URL for repository at redis.json

Actual results:
Can not find image from json file.
Can not fetch image from remote repository by flag `--image`

Expected results:
App should be created succesfully

Additional info:
`oc import docker-compose -f docker-compose.yml ` can created applications succesfully.

Comment 1 Clayton Coleman 2016-08-15 21:50:59 UTC
You need an image for all components, even those you are building.

Comment 2 XiaochuanWang 2016-08-16 03:27:15 UTC
Since there's no user story related to this, could you specify the detail more clearly please? 

After pulled the image "redis" to local and also tag it to local docker registry, seems it still does not work. 
Above json in step3 is convert from docker-compose.yml, is the json correct?
# cd docker-compose-nodejs-examples/05-nginx-express-redis-nodemon
# oc import app.json -f app.json 
error: lstat app.json/.git/objects: not a directory

Tested on origin rhel7_4832: oc v1.3.0-alpha.3+04fa89e

Comment 3 Michal Minar 2016-11-01 14:05:57 UTC

you are trying to import docker-compose.yml as an app.json. Those are two totally  different formats.

The former is described at:

The latter is described at:

I suggest to use another example application having app.json file provided.

Note You need to log in before you can comment on or make changes to this bug.