# Running containers for a bash session

Published: 2019-12-29
Last updated: 2019-12-29

Let's say you want a bash session in a brand new Centos 8 container. You can have that by running a detached container running in the background:

```bash
docker run -d -t --name centos centos:8
```

And then, by `exec`-ing bash in it:

```bash
docker exec -it centos bash
```

This works with most linux distro images like ubuntu, debian, fedora, alpine, etc.

If the container doesn't have a long running task set as the entrypoint, you can always override it using `--entrypoint`.

