Docker Community Forums

Share and learn in the Docker community.

Colored output during docker build

In docker run there is an option to create a tty with docker run -t ubuntu:18.04 ls --color=auto, which is great for getting colored output.

However, something like this is missing for docker build. For instance:

$ cat Dockerfile
FROM ubuntu:18.04

SHELL ["/bin/bash", "-c"]

ENV TERM=xterm-256color

RUN ls --color=auto

$ docker build .
// no colors

Is it possible to get colored output for RUN commands when building a docker image?