Skip to content

Add a docker build option to the 'How to contribute' wiki #656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
graue70 opened this issue Nov 23, 2019 · 10 comments
Open

Add a docker build option to the 'How to contribute' wiki #656

graue70 opened this issue Nov 23, 2019 · 10 comments
Labels
General Hacktoberfest The label for all Hacktoberfest related things!

Comments

@graue70
Copy link
Contributor

graue70 commented Nov 23, 2019

By running the command docker run --rm -v "$PWD:/gitbook" -p 4000:4000 billryan/gitbook gitbook install && gitbook serve one can entirely circumvent installing node.js and gitbook. Maybe this should be added as an alternative to the wiki explaining how to contribute?

The command is probably not perfect as one needs to install everytime one wants to serve which increases build time. I didn't quickly find a way around that. Maybe somebody else can?

@PudottaPommin
Copy link
Member

I would recommend using docker compose command as it allows a bit easier access to machine and managing it separately.

With that, unless I'm mistaken, you can make build process for docker image, which installs gitbook and next runs only invoke serve command.

@graue70
Copy link
Contributor Author

graue70 commented Nov 27, 2019

I don't see how docker-compose helps in this case, but feel free to post instructions on how to build AAA with it.

@ntindle
Copy link
Member

ntindle commented Aug 28, 2021

I can look at setting this up if we are still interested

@ntindle
Copy link
Member

ntindle commented Aug 28, 2021

I’d probably implement it as a dev container

@berquist
Copy link
Member

berquist commented Sep 6, 2021

Related: #691 (comment)

@ntindle
Copy link
Member

ntindle commented Sep 6, 2021

Here's my first pass on a handful of languages. It's not perfect but may help others so I'm putting it here for now. Will open a PR with more languages soonish.

# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/ubuntu/.devcontainer/base.Dockerfile

# [Choice] Ubuntu version: bionic, focal
ARG VARIANT="focal"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}

# [Optional] Uncomment this section to install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
    && apt-get -y install --no-install-recommends build-essential software-properties-common g++ sbcl julia python3 python3-pip python3-dev ghc openjdk-11-jdk rustc libssl-dev gfortran libxml2-dev libyaml-dev libgmp-dev libz-dev libncurses5 gnuplot nodejs npm

# Setup Crystal
RUN echo 'deb http://download.opensuse.org/repositories/devel:/languages:/crystal/xUbuntu_20.04/ /' | sudo tee /etc/apt/sources.list.d/devel:languages:crystal.list
RUN curl -fsSL https://download.opensuse.org/repositories/devel:languages:crystal/xUbuntu_20.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/devel_languages_crystal.gpg > /dev/null

# Setup Dart
RUN sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
RUN sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'

# Setup Powershell
RUN sudo sh -c 'wget -q https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb'
RUN sudo sh -c 'dpkg -i packages-microsoft-prod.deb'

# Setup Clojure
RUN sudo sh -c 'curl -O https://download.clojure.org/install/linux-install-1.10.3.967.sh'
RUN sudo sh -c 'chmod +x linux-install-1.10.3.967.sh'
RUN sudo sh -c 'sudo ./linux-install-1.10.3.967.sh'

# Setup dotnet
RUN sudo sh -c 'wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb'
RUN sudo sh -c 'sudo dpkg -i packages-microsoft-prod.deb'
RUN sudo sh -c 'rm packages-microsoft-prod.deb'

# Setup D Lang
RUN sudo sh -c 'mkdir -p ~/dlang && wget https://dlang.org/install.sh -O ~/dlang/install.sh'
RUN sudo sh -c 'bash ~/dlang/install.sh'
## From Docs not needed though
# RUN sudo sh -c 'source ~/dlang/dmd-2.097.2/activate'
ENV PATH=$PATH:/root/dlang/dmd-2.097.2/linux/bin64

# Setup Go
RUN sudo sh -c 'wget -c https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local'
ENV PATH=$PATH:/usr/local/go/bin


# Setup Emojicode
# RUN sudo sh -c 'mkdir -p ~/emojicode && wget https://github.com/emojicode/emojicode/releases/download/v1.0-beta.2/Emojicode-1.0-beta.2-Linux-x86_64.tar.gz -O ~/emojicode/emojicode.tar.gz \
# && ls && echo "ls ~" && ls ~ && echo "ls ~/emojicode/" && ls ~/emojicode/ \
# && echo "tar -xzf ~/emojicode/emojicode.tar.gz" && tar -xzf ~/emojicode/emojicode.tar.gz \
# && echo "ls ~/emojicode" && ls  ~/emojicode && echo "ls  ~/emojicode/" && ls  ~/emojicode/ \
# && echo "ls ~" && ls ~ && echo "cd ~/emojicode/"\
# && cd ~/emojicode/ && echo && ./install.sh'

# RUN 'wget https://github.com/emojicode/emojicode/releases/download/v1.0-beta.2/Emojicode-1.0-beta.2-Linux-x86_64.tar.gz -O emojicode.tar.gz \
# && tar -xzf emojicode.tar.gz && rm emojicode.tar.gz \
# && cd Emojicode-1.0-beta.2-Linux-x86_64 && ./install.sh \
# && cd .. && rm -r Emojicode-1.0-beta.2-Linux-x86_64'

# Setup Factor
RUN mkdir -p ~/factor && wget https://downloads.factorcode.org/releases/0.98/factor-linux-x86-64-0.98.tar.gz -O ~/factor/factor.tar.gz\
&& tar -xzf ~/factor/factor.tar.gz
# && rm ~/factor/factor.tar.gz
ENV PATH=$PATH:/root/factor/factor


# [Optional] Uncomment this section to install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
    && apt-get -y install --no-install-recommends crystal dart nim powershell scala dotnet-sdk-5.0

RUN pip install wheel matplotlib numpy coconut

RUN sudo sh -c 'npm install -g typescript'

@leios
Copy link
Member

leios commented Oct 9, 2021

Since we have the docker container now, I believe this can be done. I am adding a hacktoberfest label to this.

I think this can also be added to the How to contribute chapter because I will be adding in the wiki contents to the chapter soon.

@leios leios added the Hacktoberfest The label for all Hacktoberfest related things! label Oct 9, 2021
@Guzzler
Copy link

Guzzler commented Oct 23, 2021

what is supposed to done here exactly @leios I would like to pick this up if possible.

@ntindle
Copy link
Member

ntindle commented Oct 23, 2021

Howdy! Write some documentation for the resources linked in Contributing.md on how to build the dockerfile, and run some of the code within the book. Some of the expectations would be that someone without docker experience could look at the docs you write and be able to build and run the container and use it to run code in the algorithm archive

@ntindle
Copy link
Member

ntindle commented Dec 3, 2021

Add docker run instructions to how to contribute

docker run -v $(pwd):/tmp -it ghcr.io/algorithm-archivists/aaa-langs:latest bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
General Hacktoberfest The label for all Hacktoberfest related things!
Projects
None yet
Development

No branches or pull requests

6 participants