I Build an dockerfile for centos7 and a docker-compose file for linking volumes to the container and set some local variables. When i start the container with
docker-compose up --build
My dockerfile does its work. After starting the container it exits with Exitcode 0.
I want to acess my container by shell. How can i do that without terminating the container and staying open?
My Dockerfile:
FROM centos:7
RUN yum -y update
CMD /bin/sh
My Composer file:
version: '2'
services:
media:
build: .
volumes:
- ./media:/media
- ./media/bin/x86_64/release/:/usr/local/lib/
command: bash
environment:
- LD_LIBRARY_PATH=usr/lib64:/usr/local/lib
expose:
- "8080"
- "80"
- "443"
Any ideas?
To keep it open in a normal docker usage is explained already, but not in context to the usage with docker-compose.