Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-instant-1· AnthropicHugging Face Arena Human Preference 55K

write a docker file which uses nice bash prompts when using the console of that container

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Microsoftwizardlm-70b’s answer.
  1. User

    write a docker file which uses nice bash prompts when using the console of that container

  2. Claude Assistant

    Here is a Dockerfile that will set up nice bash prompts when using the container console:

    FROM ubuntu
    
    RUN apt-get update && apt-get install -y bash-completion
    
    # Add bash prompt customization
    COPY bash_prompt.sh /etc/profile.d/bash_prompt.sh
    
    RUN chmod +x /etc/profile.d/bash_prompt.sh
    
    # Set bash as default shell
    RUN echo '#!/bin/bash' > /etc/shells
    RUN echo '/bin/bash' >> /etc/shells
    
    # Set nice bash prompt
    ENV PS1='[\u@\h \W]\$ '
    
    CMD ["/bin/bash"]
    

    The key things it does:

    • Installs bash-completion for tab autocomplete
    • Copies a bash_prompt.sh file that contains PS1 customization
    • Sets bash as the default shell
    • Sets a nice colorful PS1 prompt string
    • Runs bash on container start

    The bash_prompt.sh file would contain something like:

    PS1='[\u@\h \W]\$ '
    

    This sets a simple but nice looking prompt with user, hostname and current directory. You can customize it further as desired.

    Now when running the container interactively with docker run -it, it will have a customized bash prompt.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.