neko/.devcontainer/Dockerfile

52 lines
2.3 KiB
Docker
Raw Normal View History

2020-04-19 08:56:13 +12:00
FROM nurdism/neko:dev
2020-01-28 20:07:35 +13:00
2020-04-05 13:25:30 +12:00
# Use the "remoteUser" property in devcontainer.json to use it. On Linux, the container
# user's GID/UIDs will be updated to match your local UID/GID (when using the dockerFile property).
2020-01-28 20:07:35 +13:00
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
ARG USERNAME=neko
ARG USER_UID=1000
ARG USER_GID=$USER_UID
2020-01-31 13:42:05 +13:00
#
2020-04-05 13:25:30 +12:00
# Set to false to skip installing zsh and Oh My ZSH!
2020-01-28 20:07:35 +13:00
ARG INSTALL_ZSH="true"
2020-01-31 13:42:05 +13:00
#
2020-04-05 13:25:30 +12:00
# Location and expected SHA for common setup script - SHA generated on release
2020-01-28 20:07:35 +13:00
ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/common-debian.sh"
ARG COMMON_SCRIPT_SHA="dev-mode"
2020-02-03 11:48:23 +13:00
#
# Docker Compose version
ARG COMPOSE_VERSION=1.24.0
2020-01-31 13:42:05 +13:00
#
2020-04-05 13:25:30 +12:00
# Verify git, common tools / libs installed, add/modify non-root user, optionally install zsh
2020-01-31 13:42:05 +13:00
RUN set -eux; \
wget -q -O /tmp/common-setup.sh $COMMON_SCRIPT_SOURCE; \
2020-01-30 20:19:57 +13:00
if [ "$COMMON_SCRIPT_SHA" != "dev-mode" ]; then echo "$COMMON_SCRIPT_SHA /tmp/common-setup.sh" | sha256sum -c - ; fi; \
/bin/bash /tmp/common-setup.sh "$INSTALL_ZSH" "$USERNAME" "$USER_UID" "$USER_GID"; \
rm /tmp/common-setup.sh; \
2020-01-28 20:07:35 +13:00
#
2020-04-05 13:25:30 +12:00
# Install docker
2020-01-30 20:19:57 +13:00
apt-get install -y apt-transport-https gnupg-agent software-properties-common lsb-release; \
curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | (OUT=$(apt-key add - 2>&1) || echo $OUT); \
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable"; \
apt-get update; apt-get install -y docker-ce-cli; \
2020-01-28 20:07:35 +13:00
#
2020-04-05 13:25:30 +12:00
# Install docker compose
2020-01-30 20:19:57 +13:00
curl -sSL "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose; \
chmod +x /usr/local/bin/docker-compose; \
2020-01-28 20:07:35 +13:00
#
2020-04-05 13:25:30 +12:00
# Set alternate global install location that both users have rights to access
2020-01-30 20:19:57 +13:00
mkdir -p /usr/local/share/npm-global; \
chown ${USERNAME}:root /usr/local/share/npm-global; \
npm config -g set prefix /usr/local/share/npm-global; \
sudo -u ${USERNAME} npm config -g set prefix /usr/local/share/npm-global
2020-01-28 20:07:35 +13:00
2020-01-29 05:45:00 +13:00
ENV PATH=/usr/local/share/npm-global/bin:$PATH
2020-01-31 13:42:05 +13:00
#
2020-01-28 20:07:35 +13:00
# switch back to dialog for any ad-hoc use of apt-get
2020-01-29 05:45:00 +13:00
ENV DEBIAN_FRONTEND=dialog