-
Notifications
You must be signed in to change notification settings - Fork 771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mongodb startup problem with simple dockerfile #489
Comments
@stephanosbacon You are getting this error because you are trying to run an application which requires root privilege to inside the container. OpenShift by default, does not allow the container to run using |
Actually, it works for me with oc new-app.. I'm using minishift by the way. |
problem is with volumes.
with Kompose volumes have to be defined explicitly. version: '2'
services:
mongo:
image: "mongo"
ports:
- "27017:27017"
volumes:
- /data/db
- /data/configdb If you want deploy this to minishift (or any other cluster that doesn't support PersistentVolumes) you have to add
For cluster with PersistentVolumes or with storage auto-provisioning setup you can omit
|
Thanks! |
i think we can close this |
The following dockerfile:
version: '2'
services:
mongo:
image: "mongo"
ports:
- "27017:27017"
when processed with:
kompose convert -f docker-compose.yml --provider OpenShift
will generate mongo-imagestream, mongo-deploymentconfig and mongo-service, which, when deployed to OpenShift (Minishift in this case) as follows:
oc create -f mongo-imagestream.yaml
oc create -f mongo-deploymentconfig.yaml
oc create -f mongo-service.yaml
will result in mongodb not starting with the following log [1]
However, if I say "oc new-app --docker-image=mongo" mongo starts up without a problem.
[1] The log:
2017-03-13T17:26:40.695+0000 I CONTROL [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=cablegram-1-b1zua
2017-03-13T17:26:40.695+0000 I CONTROL [initandlisten] db version v3.4.2
2017-03-13T17:26:40.695+0000 I CONTROL [initandlisten] git version: 3f76e40c105fc223b3e5aac3e20dcd026b83b38b
2017-03-13T17:26:40.695+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1t 3 May 2016
2017-03-13T17:26:40.695+0000 I CONTROL [initandlisten] allocator: tcmalloc
2017-03-13T17:26:40.695+0000 I CONTROL [initandlisten] modules: none
2017-03-13T17:26:40.695+0000 I CONTROL [initandlisten] build environment:
2017-03-13T17:26:40.695+0000 I CONTROL [initandlisten] distmod: debian81
2017-03-13T17:26:40.695+0000 I CONTROL [initandlisten] distarch: x86_64
2017-03-13T17:26:40.695+0000 I CONTROL [initandlisten] target_arch: x86_64
2017-03-13T17:26:40.695+0000 I CONTROL [initandlisten] options: {}
2017-03-13T17:26:40.695+0000 I STORAGE [initandlisten] exception in initAndListen: 20 Attempted to create a lock file on a read-only directory: /data/db, terminating
2017-03-13T17:26:40.695+0000 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2017-03-13T17:26:40.695+0000 I NETWORK [initandlisten] shutdown: going to flush diaglog...
2017-03-13T17:26:40.695+0000 I CONTROL [initandlisten] now exiting
2017-03-13T17:26:40.695+0000 I CONTROL [initandlisten] shutting down with code:100
The text was updated successfully, but these errors were encountered: