I’m trying to setup a personal development environment inside a Docker container. I’m using iTerm 2 on macOS and the default “Dark Background” colors.
Outside of Docker, ls
displays directories in light blue like it should. However, ls
inside a docker container displays directories dark blue for some reason. I have already set $TERM=xterm-256color
inside my container using an ENV
line in my Dockerfile. I’ve verified this by echoing $TERM
out inside the container as shown in the screenshots below.
I’m trying to figure out why the colors inside the container aren’t correct and how I can fix this.
I’m starting my container as follows: docker build -q -t jswny/devbox . && docker run -it -h devbox --name devbox jswny/devbox bash
.
Here is my Dockerfile
:
FROM ubuntu:18.04
RUN apt-get update
# Set environment variables
ENV TERM xterm-256color
# Install essentials
RUN apt-get install -y \
make \
cmake \
git \
curl
# Install user packages
RUN apt-get install -y \
tmux \
zsh
# Change default shell to ZSH
RUN chsh -s $(which zsh)
# Install Oh My Zsh
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# Install asdf
RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.6.3
RUN echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.zshrc
RUN echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc
# RUN source ~/.zshrc
# Remove default .zshrc
RUN rm ~/.zshrc
# Add custom config files
ADD dotfiles /root/
WORKDIR /root
# Override this as needed
CMD ["/usr/bin/zsh"]
Here is what ls
looks like on my local machine:
And here is what it looks like inside my container:
Imgur link since I can’t upload two pictures to the same post
Thanks!