MongoDB Docker?

892 views
Skip to first unread message

Kevin Burton

unread,
Jan 1, 2018, 3:27:58 PM1/1/18
to mongodb-user
This question may be directed to the wrong group. If so please redirect me.
Has anyone been able to get the mongoDB docker image to run? I am running

docker run -it --link some-mongo:mongo --rm mongo sh -c 'exec mongo "$MONGO_PORT_27017_TCP_ADDR:$MONGO_PORT_27017_TCP_PORT/test"'

As it shows on the usage for the docker image on DockerHub

and I get


2018-01-01T20:21:12.443+0000 I CONTROL  [initandlisten] db version v3.6.1
2018-01-01T20:21:12.443+0000 I CONTROL  [initandlisten] git version: 025d4f4fe61efd1fb6f0005be20cb45a004093d1
2018-01-01T20:21:12.443+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1t  3 May 2016
2018-01-01T20:21:12.443+0000 I CONTROL  [initandlisten] allocator: tcmalloc
2018-01-01T20:21:12.443+0000 I CONTROL  [initandlisten] modules: none
2018-01-01T20:21:12.443+0000 I CONTROL  [initandlisten] build environment:
2018-01-01T20:21:12.443+0000 I CONTROL  [initandlisten]     distmod: debian81
2018-01-01T20:21:12.443+0000 I CONTROL  [initandlisten]     distarch: x86_64
2018-01-01T20:21:12.443+0000 I CONTROL  [initandlisten]     target_arch: x86_64
2018-01-01T20:21:12.443+0000 I CONTROL  [initandlisten] options: { net: { bindIpAll: true } }
2018-01-01T20:21:12.446+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=478M,session_max=20000
,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,
compressor
=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2018-01-01T20:21:12.539+0000 E STORAGE  [initandlisten] WiredTiger error (17) [1514838072:539905][1:0x7ff35216da00], con
nection
: /data/db/WiredTiger.wt: handle-open: open: File exists
2018-01-01T20:21:12.542+0000 I STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed
to
WiredTiger.wt.1
2018-01-01T20:21:12.544+0000 E STORAGE  [initandlisten] WiredTiger error (1) [1514838072:544076][1:0x7ff35216da00], conn
ection
: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
2018-01-01T20:21:12.545+0000 E -        [initandlisten] Assertion: 28595:1: Operation not permitted src/mongo/db/storage
/wiredtiger/wiredtiger_kv_engine.cpp 413
2018-01-01T20:21:12.546+0000 I STORAGE  [initandlisten] exception in initAndListen: Location28595: 1: Operation not perm
itted
, terminating
2018-01-01T20:21:12.546+0000 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2018-01-01T20:21:12.546+0000 I NETWORK  [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2018-01-01T20:21:12.546+0000 I CONTROL  [initandlisten] now exiting
2018-01-01T20:21:12.546+0000 I CONTROL  [initandlisten] shutting down with code:100

The error "Operation not permitted" is not illuminating to me. Ideas?

Thank you.

Kevin

Kevin Burton

unread,
Jan 1, 2018, 3:37:49 PM1/1/18
to mongodb-user
I should note that the first time I run I get a different WiredTiger error

2018-01-01T20:31:11.554+0000 I CONTROL  [initandlisten] db version v3.6.1
2018-01-01T20:31:11.554+0000 I CONTROL  [initandlisten] git version: 025d4f4fe61efd1fb6f0005be20cb45a004093d1
2018-01-01T20:31:11.554+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1t  3 May 2016
2018-01-01T20:31:11.554+0000 I CONTROL  [initandlisten] allocator: tcmalloc
2018-01-01T20:31:11.554+0000 I CONTROL  [initandlisten] modules: none
2018-01-01T20:31:11.554+0000 I CONTROL  [initandlisten] build environment:
2018-01-01T20:31:11.554+0000 I CONTROL  [initandlisten]     distmod: debian81
2018-01-01T20:31:11.554+0000 I CONTROL  [initandlisten]     distarch: x86_64
2018-01-01T20:31:11.554+0000 I CONTROL  [initandlisten]     target_arch: x86_64
2018-01-01T20:31:11.554+0000 I CONTROL  [initandlisten] options: { net: { bindIpAll: true } }
2018-01-01T20:31:11.560+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=478M,session_max=20000
,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,
compressor
=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2018-01-01T20:31:11.639+0000 E STORAGE  [initandlisten] WiredTiger error (1) [1514838671:639789][1:0x7f6326926a00], conn
ection
: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
2018-01-01T20:31:11.642+0000 E -        [initandlisten] Assertion: 28595:1: Operation not permitted src/mongo/db/storage
/wiredtiger/wiredtiger_kv_engine.cpp 413
2018-01-01T20:31:11.642+0000 I STORAGE  [initandlisten] exception in initAndListen: Location28595: 1: Operation not perm
itted
, terminating
2018-01-01T20:31:11.643+0000 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2018-01-01T20:31:11.643+0000 I NETWORK  [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2018-01-01T20:31:11.643+0000 I CONTROL  [initandlisten] now exiting

Kevin Adistambha

unread,
Jan 17, 2018, 1:17:42 AM1/17/18
to mongodb-user

Hi

Following the instructions in Docker Hub Mongo seems to work:

$ docker run --name some-mongo -d mongo
449859c3e8f9fd4f2538e74bd23c4eacbc95131da9f195f24d4069bb084c3687

$ docker run -it --link some-mongo:mongo --rm mongo sh -c 'exec mongo "$MONGO_PORT_27017_TCP_ADDR:$MONGO_PORT_27017_TCP_PORT/test"'
MongoDB shell version v3.6.2
connecting to: mongodb://172.17.0.2:27017/test
MongoDB server version: 3.6.2
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
    http://docs.mongodb.org/
Questions? Try the support group
    http://groups.google.com/group/mongodb-user
Server has startup warnings:
2018-01-17T06:10:49.452+0000 I STORAGE  [initandlisten]
2018-01-17T06:10:49.452+0000 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2018-01-17T06:10:49.452+0000 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2018-01-17T06:10:49.484+0000 I CONTROL  [initandlisten]
2018-01-17T06:10:49.484+0000 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-01-17T06:10:49.484+0000 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2018-01-17T06:10:49.484+0000 I CONTROL  [initandlisten]
2018-01-17T06:11:00.709+0000 E -        [main] Error loading history file: FileOpenFailed: Unable to fopen() file /root/.dbshell: No such file or directory
>

The Error loading history file can be ignored, it simply says that it cannot open your history file.

Could you show the step-by-step commands you used that resulted in the error?

Please note that the mongo image in Docker Hub is not officially supported by MongoDB.

Best regards
Kevin

Kevin Burton

unread,
Jan 17, 2018, 1:40:22 PM1/17/18
to mongodb-user
I was concerned about the error that I was getting detailed above.

Kevin Adistambha

unread,
Jan 17, 2018, 4:14:28 PM1/17/18
to mongodb-user

Hi

I did not get the error you’re seeing by following the instructions on Docker Hub (which I posted the output earlier).

The “Operation not permitted” error is typically caused by the mongod process not having the permission to write to the /data/db directory. However, without knowing what exactly you did and how your Docker environment is setup, this is just a guess.

Also, the output you posted was the server’s output, however the command line you posted was for entering the mongo shell.

To know more about what happened, please post the step-by-step commands you used to arrive at that error.

Best rregards
Kevin

Reply all
Reply to author
Forward
0 new messages