Dockerfile
FROM get some base image ENV ProjectDir /workarea/svc RUN mkdir -p $ProjectDir WORKDIR $ProjectDir docker-compose.yaml
version: "3.7" services: svc: build: context: . dockerfile: Dockerfile volumes: - .:/workarea/svc command: ["/opt/bb/bin/bash"] When I run docker-compose up it exits immediately
r@PW02R9F3:$ docker-compose up Creating svc_dev_1 ... done Attaching svc_dev_1 svc_dev_1 exited with code 0 But when I run "docker-compose run --rm dev" I am able to get into bash as specified in the command session of my docker-compose.yaml file
r@PW02R9F3:$ docker-compose run --rm dev Creating svc_dev_run ... done [root@ad5d3d7107b4 svc]# Why is this happening? Isnt "docker-compose up" running my command "/opt/bb/bin/bash" in the docker-compose.yaml file?