I am a Docker newbie working with a private copy of the Coral Talk project (Docker Hub).
I first tried to install from the source available from the Coralprojet Github repo, but ran into many problems. Because the developers offer both source and container versions, I tried building my own container from the source that I modified slightly. It took a really long time to build but in the end, it worked!
I then installed the software - or anyway got the thing running - using the commands provided by the Coral developers for use with their own Docker image and provided example docker-compose.yml
file, as below:
# Create directories to persist the data in MongoDB and Redis.
mkdir -p data/{mongo,redis}
# Create the `docker-compose.yml` file to get started.
cat > docker-compose.yml <<EOF
version: "2"
services:
talk:
# Changed image: to my private repo on hub.docker.com. Everything else the same
image: coralproject/talk:6
restart: always
ports:
- "127.0.0.1:3000:5000"
depends_on:
- mongo
- redis
environment:
- MONGODB_URI=mongodb://mongo:27017/coral
- REDIS_URI=redis://redis:6379
- SIGNING_SECRET=<replace me with something secret>
mongo:
image: mongo:4.2
volumes:
- ./data/mongo:/data/db
redis:
image: redis:3.2
volumes:
- ./data/redis:/data
EOF
# Start up Coral using Docker.
docker-compose up -d
It ran perfectly!
Now however, I need to make some further changes to my version of the Coral app.
I can build a new image, but how can I replace the image without touching the Mongo database?
I already learned that docker-compose down
wipes out any data.
What would be the correct series of commands to stop the system, replace the image, and restart?