|
| 1 | +#------------------------------------------------------------------------------------------------------------- |
| 2 | +# Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 | +# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. |
| 4 | +#------------------------------------------------------------------------------------------------------------- |
| 5 | + |
| 6 | +FROM node:lts |
| 7 | + |
| 8 | +# Avoid warnings by switching to noninteractive |
| 9 | +ENV DEBIAN_FRONTEND=noninteractive |
| 10 | + |
| 11 | +# Configure apt and install packages |
| 12 | +RUN apt-get update \ |
| 13 | + && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ |
| 14 | + # |
| 15 | + # Verify git and needed tools are installed |
| 16 | + && apt-get -y install git iproute2 procps direnv vim less \ |
| 17 | + # |
| 18 | + # Install eslint globally |
| 19 | + && npm install -g eslint \ |
| 20 | + # |
| 21 | + # Clean up |
| 22 | + && apt-get autoremove -y \ |
| 23 | + && apt-get clean -y \ |
| 24 | + && rm -rf /var/lib/apt/lists/* |
| 25 | + |
| 26 | +# Install Zsh, Oh-My-Zsh and plugins |
| 27 | +RUN sh -c "$(curl https://raw.githubusercontent.com/deluan/zsh-in-docker/master/zsh-in-docker.sh)" -- \ |
| 28 | + -p git -p ssh-agent \ |
| 29 | + -p https://github.com/zsh-users/zsh-autosuggestions \ |
| 30 | + -p https://github.com/zsh-users/zsh-completions \ |
| 31 | + -p https://github.com/zsh-users/zsh-history-substring-search \ |
| 32 | + -p https://github.com/zdharma/fast-syntax-highlighting |
| 33 | + |
| 34 | +# Override Powerlevel9(10)k prompt provided by zsh-in-docker |
| 35 | +RUN echo 'POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(root_indicator dir vcs status)' >> ~/.zshrc |
| 36 | + |
| 37 | +# Configure direnv (https://direnv.net/) |
| 38 | +RUN echo '[ -f /workspaces/contentful-migrate/.envrc ] && eval "$(direnv hook zsh)"' >> ~/.zshrc |
| 39 | + |
| 40 | +# Switch back to dialog for any ad-hoc use of apt-get |
| 41 | +ENV DEBIAN_FRONTEND= |
0 commit comments