Created
May 5, 2021 17:21
-
-
Save andrewzigerelli/05f961107905e690efd806d34eb495f1 to your computer and use it in GitHub Desktop.
leetcode-cli Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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