Skip to content
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

tini spawning shell not CMD #96

Closed
vitosans opened this issue Aug 1, 2017 · 1 comment
Closed

tini spawning shell not CMD #96

vitosans opened this issue Aug 1, 2017 · 1 comment

Comments

@vitosans
Copy link

vitosans commented Aug 1, 2017

Not sure if this is an issue or user error.

  • tini (version 0.9.0)
  • Docker 17.06.1-ce-rc1-mac20 (18682)
  • Alpine 3.6

I have two containers that I am experimenting using tini and su-exec with. The first container is a tomcat container and everything is working just fine, a text book example if you would.

The second container is a Redis container and this one for some reason only wants to run /bin/sh not what ever is in the CMD of the Dockerfile.

ENTRYPOINT ["/sbin/tini", "--"]
CMD ["start-app.sh", "redis-server", "/etc/redis.conf"]  

The contents of start-app.sh are not much

if [ "$1" = 'redis-server' -a "$(id -u)" = '0' ]; then
    # Change the ownership
    chown -R redis:redis /data
    exec su-exec redis:redis "$@"                                                                                                                                                       
else
    exec "$@"
fi

When I build and run this my container exits immediately.

docker logs -f redis is empty

docker inspect -f "{{.Name}} {{.Config.Cmd}}" $(docker ps -a -q)

/redis [/bin/sh]
/tomcat [start-app.sh catalina]

So I see that Tomcat is working but for some odd reason the Redis container is only running a shell.. The weird thing is both containers inherit from the same base Alpine container except the Tomcat container adds Java 8.

Any thoughts?

@vitosans
Copy link
Author

vitosans commented Aug 1, 2017

100% user error.

Closed.

@vitosans vitosans closed this as completed Aug 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant