dzm
dzm

Reputation: 23534

Redis server does not start after install in Docker

I'm using the official ubuntu image and installing redis via apt-get install redis-server

This all works fine, however redis doesn't start. If I connect to the container and run redis-server & this will start redis in background. I've tried adding RUN redis-server & but that doesn't seem to work.

Any ideas how to get redis to start?

Upvotes: 2

Views: 4049

Answers (2)

Cihan B.
Cihan B.

Reputation: 337

You can use the following dockerfile and simply change the first line to FROM ubuntu:latest or the specific version you need a run "docker build"

Upvotes: 0

Anthony Kong
Anthony Kong

Reputation: 40624

RUN redis-serve only runs during docker build time.

You can use either CMD redis-server or ENTRYPOINT redis-server && bash in your dockerfile.

Upvotes: 2

Related Questions