diff --git a/.devcontainer.json b/.devcontainer.json index 54a61b9..a95311b 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -1,4 +1,13 @@ { - "image": "angrymaciek/angry-runner", - "postCreateCommand": "bash /bin/entrypoint.sh" + "name": "dev", + + "build": { + "dockerfile": "./Dockerfile" + }, + + "customizations": { + "codespaces": { + "openFiles": [] + } + } } diff --git a/Dockerfile b/Dockerfile index e9e7b7a..6d470d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1 +1,46 @@ +##### BASE IMAGE ##### FROM ubuntu:22.04 + +##### METADATA ##### +LABEL base.image="ubuntu:22.04" +LABEL version="1.1.2" +LABEL maintainer="Maciek Bak" + +##### DEFINE BUILD/ENV VARIABLES ##### +ARG MAMBADIR="/mambaforge" +ARG MAMBAURL="https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh" +ENV LANG C.UTF-8 + +##### INSTALL SYSTEM-LEVEL DEPENDENCIES ##### +RUN apt-get update \ + && apt-get install --no-install-recommends --yes \ + ca-certificates cmake curl g++ gcc git gnupg2 gosu make vim wget \ + && apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +##### INSTALL MAMBAFORGE & PKGS ##### +RUN /bin/bash -c "curl -L ${MAMBAURL} > mambaforge.sh \ + && bash mambaforge.sh -b -p ${MAMBADIR} \ + && ${MAMBADIR}/bin/conda config --system --set channel_priority strict \ + && source ${MAMBADIR}/bin/activate \ + && conda init bash \ + && mamba install boa conda-build conda-verify -c conda-forge --yes \ + && conda clean --all --yes \ + && rm -f mambaforge.sh" + +##### EXPOSE PORTS ##### +EXPOSE 8888 + +##### PREPARE WORKING DIRECTORY ##### +VOLUME /workdir +WORKDIR /workdir + +##### SETUP ENTRYPOINT W/ NONROOT USER ##### +COPY entrypoint.sh /bin/entrypoint.sh +RUN /bin/bash -c "chmod +x /bin/entrypoint.sh \ + && groupadd conda \ + && chgrp -R conda ${MAMBADIR} \ + && chmod 770 -R ${MAMBADIR}" +ENTRYPOINT ["/bin/entrypoint.sh"] +CMD ["/bin/bash"] \ No newline at end of file