File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,9 +47,28 @@ RUN apk add --no-cache \
4747 jq \
4848 nano
4949
50- RUN echo -e "\nYou are now in a development container. Run '\e\033[1mmake help\e\033[0m' to learn about\navailable make targets.\n" > /etc/motd \
51- && echo -e "cat /etc/motd\nPS1=\"\e[0;32m\u@docker-cli-dev\\$ \e[0m\"" >> /root/.bashrc \
52- && echo -e "source /etc/bash/bash_completion.sh" >> /root/.bashrc
50+ RUN <<-'EOF'
51+ cat > /etc/motd <<-'EOM'
52+ \e[1;32mYou are now in a development container.\e[0m
53+
54+ Run \e[1;36mmake help\e[0m to see available targets.
55+ EOM
56+
57+ cat >> /root/.bashrc <<-'EOB'
58+ # print the MOTD when opening the dev-container (interactive shell only).
59+ if [[ $- == *i* ]] && [[ -z "$MOTD_SHOWN" ]]; then
60+ printf "%b\n" "$(cat /etc/motd)"
61+ export MOTD_SHOWN=1
62+ fi
63+
64+ # set a custom prompt to make it more visible when inside the dev-container.
65+ PS1='\[\e[0;32m\]\u@docker-cli-dev\$ \[\e[0m\]'
66+
67+ # set-up bash completion for testing.
68+ source /etc/bash/bash_completion.sh
69+ EOB
70+ EOF
71+
5372CMD ["/bin/bash"]
5473ENV DISABLE_WARN_OUTSIDE_CONTAINER=1
5574ENV PATH=$PATH:/go/src/github.com/docker/cli/build
You can’t perform that action at this time.
0 commit comments