Skip to content
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

[FEATURE]: Can the Dockerfile used to create the referenced docker image be added to the repo? #25

Open
1 task done
brspurri opened this issue Jul 17, 2024 · 1 comment
Labels
enhancement New feature or request needs-triage Review is required to valid the label

Comments

@brspurri
Copy link

brspurri commented Jul 17, 2024

Feature Title

Dockerfile

Feature Summary

Can the Dockerfile used to create the referenced docker image be added to the repo?
It would be very useful as I need to recreate the image with a minor modification.

Motivation and Context

Currently, the docker image cannot be recreated.

Technical Details and Implementation

No response

Duplicate Check

  • I have searched the existing feature requests and did not find a duplicate.
@brspurri brspurri added enhancement New feature or request needs-triage Review is required to valid the label labels Jul 17, 2024
@nchenche
Copy link
Collaborator

Hi @brspurri,

You will find below the Dockerfile instructions. It's been a long time since I have not seen it, so it certainly is optimizable.

Also, before running the Dockerfile,you will need to create a softwares directory where you must add APBS-3.4.1 (from https://github.com/Electrostatics/apbs/releases/tag/v3.4.1).

├── CHANGELOG.md

├── doc
├── Dockerfile
├── LICENSE
├── MANIFEST.in
├── README.md
├── setup.py
├── softwares
        └── APBS-3.4.1.Linux
├── surfmap

Dockerfile

# 1st build stage: base image for ubuntu
#################
FROM ubuntu:22.04 as base_os_ubuntu

# to not the user being asked validations upon install process 
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get install -y \
    software-properties-common \
    && add-apt-repository ppa:deadsnakes/ppa 

RUN apt-get update && apt-get install -y \
    build-essential \
    fort77 \
    gcc-11 \
    less \
	vim-tiny 



# 2nd build stage: add R
#################
FROM base_os_ubuntu as base_os_with_r

RUN apt-get update && apt-get install -y \
    r-base

# 3rd build stage: add python3.10
#################
FROM base_os_with_r as base_os_with_python

RUN apt-get update && apt-get install -y \
    python3.10 \
    python3-pip



# 4th build stage: add R library dependencies
#################
FROM base_os_with_python as base_os_with_r_lib
RUN R -e "install.packages(c('optparse', 'data.table', 'mapproj'))"



# 5th build stage: add APBS-3.4.1 (from https://github.com/Electrostatics/apbs/releases/tag/v3.4.1) - requires to be placed in a directory called 'softwares' at the same level of Dockerfile
#################
FROM base_os_with_r_lib as base_os_with_apbs

# go to home surfmap
WORKDIR /surfmap

# copy APBS in /surfmap
COPY softwares/APBS-3.4.1.Linux APBS/

# set env vars for APBS
ENV APBS=/surfmap/APBS
ENV LD_LIBRARY_PATH=$APBS/lib
ENV PATH=$APBS/bin:$PATH



# 6th build stage: add surfmap package
#################
FROM base_os_with_apbs as surfmap_package

WORKDIR /surfmap

# install virtualenv, create one and add its bin directory into PATH
RUN pip install virtualenv && \
    virtualenv -p python3.10 .env

ENV PATH=/surfmap/.env/bin:$PATH

# add surfmap packages and setup.py
COPY ./ ./

# # install ORFmine python libraries & dependencies 
RUN pip install -e .

# create surfmap group and user (from https://github.com/dnaprawa/dockerfile-best-practices#run-as-a-non-root-user)
RUN adduser surfmap

# go to home surfmap
WORKDIR /home/surfmap

# run container as surfmap user and add input & output dirs
USER surfmap
RUN mkdir input output

Bests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-triage Review is required to valid the label
Projects
None yet
Development

No branches or pull requests

2 participants