Docker Community Forums

Share and learn in the Docker community.

Exit Zero, add -dit, bash & all to docker-compose.yml

(Turtlewolfe) #1

$ docker run --name u1804 -dit -p 8080:80 ubuntu:18.04 //bin/bash

$docker attach u1804

Running these 2 commands will get me into the prompt of a Linux system, which is really all I need for now. Most of my time has been on Windows or Mac… so I really just want a Local Linux to review from first principles.

root@u1804:/# exit

It’s been much easier to find tutorials about running Docker on Linux rather than Linux in Docker…
Now, I’m trying to move that functionality into docker-compose.yml so with just compose-docker up brings me back to that same Linux prompt. I’m getting as far as an exit zero, it looks like it’s pulling the image and building the container, but then it exits with a zero because it’s finished… I’m not sure about the syntax to add exec CMD or RUN to remain attached to the terminal from running docker-compose up

  1. -detached
  2. -interactive
  3. -TTY and the
  4. //bash call?
    Also, instead of just adding the usr/local/, could I expose the entire file structure of 18.04 to local development?


version: "3.2"
    image: ubuntu:${DISTRO:-bionic}
      - "8080:80"
      - ./usr_local/:/usr/local/
    container_name: u1804