Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Ok,

Again answering myself my questions. This particular docker container was not supposed to be running permanently. The nova-docker driver somehow tries to look for a pid associated to this container. If the container has already finished his job to do, then it can't be registered to Openstack.

So my dirty solution was to add something like that on my docker-entrypoint.sh:

if [ "$@" ] then exec "$@" else echo "Container running!" sleep 3h fi

So when I start this container without parameters (which is the case of nova-docker), I just sleep so everyone knows that this container has to be registered on OpenStack and nothing fails.

I guess that it would be good to give support to this kind of containers on nova-docker. If not, it is necessary to perform hacks like this in all your containers.

Cheers,

Ok,

Again answering myself my questions. This particular docker container was not supposed to be running permanently. The nova-docker driver somehow tries to look for a pid associated to this container. If the container has already finished his job to do, then it can't be registered to Openstack.

So my dirty solution was to add something like that on my docker-entrypoint.sh:

if [ "$@" ] then ]

then

exec "$@"
else
    

else

echo "Container running!"
  sleep 3h

fi

So when I start this container without parameters (which is the case of nova-docker), I just sleep so everyone knows that this container has to be registered on OpenStack and nothing fails.

I guess that it would be good to give support to this kind of containers on nova-docker. If not, it is necessary to perform hacks like this in all your containers.

Cheers,

Ok,

Again answering myself my questions. This particular docker container was not supposed to be running permanently. The nova-docker driver somehow tries to look for a pid associated to this container. If the container has already finished his job to do, then it can't be registered to Openstack.

So my dirty solution was to add something like that on my docker-entrypoint.sh:

if [ "$@" ]

then

exec "$@"

else

echo "Container running!"

sleep 3h

fi

So when I start this container without parameters (which is the case of nova-docker), I just sleep so everyone knows that this container has to be registered on OpenStack and nothing fails.

I guess that it would be good to give support to this kind of containers on nova-docker. If not, it is necessary to perform hacks like this in all your containers.

Cheers,

EDIT: You can add your entrypoint at the end of the Dockerfile. Make sure that it is located in the same folder that your Dockerfile:

COPY docker-entrypoint.sh /entrypoint.sh

RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]

EXPOSE 80 22 30000-60000

Ok,

Again answering myself my questions. This particular docker container was not supposed to be running permanently. The nova-docker driver somehow tries to look for a pid associated to this container. If the container has already finished his job to do, then it can't be registered to Openstack.

So my dirty solution was to add something like that on my docker-entrypoint.sh:

if [ "$@" ]

then

 

exec "$@"

"$@"

else

 

echo "Container running!" running!"

sleep 3h

3h

fi

So when I start this container without parameters (which is the case of nova-docker), I just sleep so everyone knows that this container has to be registered on OpenStack and nothing fails.

I guess that it would be good to give support to this kind of containers on nova-docker. If not, it is necessary to perform hacks like this in all your containers.

Cheers,

EDIT: You can add your entrypoint at the end of the Dockerfile. Make sure that it is located in the same folder that your Dockerfile:

COPY docker-entrypoint.sh /entrypoint.sh

RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]

EXPOSE 80 22 30000-60000