Skip to content

Instantly share code, notes, and snippets.

@andrewzigerelli
Created May 5, 2021 17:21
Show Gist options
  • Save andrewzigerelli/05f961107905e690efd806d34eb495f1 to your computer and use it in GitHub Desktop.
Save andrewzigerelli/05f961107905e690efd806d34eb495f1 to your computer and use it in GitHub Desktop.
leetcode-cli Dockerfile
FROM debian:stable-slim
# change to login shell so we can source
SHELL ["/bin/bash", "-l", "-c", "-o", "pipefail"]
# needed for npm
WORKDIR /root/
# install needed packages
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
jq
# install latest nvm by parsing github api result
RUN curl -o- \
https://raw.githubusercontent.com/nvm-sh/nvm/\
$(curl https://api.github.com/repos/nvm-sh/nvm/releases/latest | \
jq -r '.tag_name')/install.sh | bash
# install node and leetcode-cli
RUN source /root/.nvm/nvm.sh && \
nvm install node && \
npm install -g https://github.com/leetcode-tools/leetcode-cli.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment