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

Docker Images #270

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/build_deploy_latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build and deploy to DockerHub

on:
push:
branches:
- master

# Specify jobs
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
config:
- { image_name: ubuntu-build, dockerfile: ubuntu.Dockerfile }
steps:
- uses: actions/checkout@master
- name: Login, build and push image
if: success()
uses: whoan/docker-build-with-cache-action@v4
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
image_name: "genrl/${{matrix.config.image_name}}"
dockerfile: "docker/${{matrix.config.dockerfile}}"
push_image_and_stages: true
37 changes: 37 additions & 0 deletions docker/ubuntu.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM ubuntu:latest

# Install baseline required tools
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections \
&& apt-get update && \
apt install -y --no-install-recommends \
# C++
build-essential g++ gcc git make wget \
# Python
python-setuptools python-dev \
sudo \
libgtk2.0-dev \
&& apt-get install -y --reinstall ca-certificates \
# Do this cleanup every time to ensure minimal layer sizes
# TODO: Turn this into a script
&& apt-get clean autoclean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/{apt,dpkg,cache,log}

COPY ./requirements.txt requirements.txt

RUN wget --no-check-certificate https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh \
&& bash miniconda.sh -b -p /usr/local/miniconda \
&& hash -r \
&& /usr/local/miniconda/bin/conda config --set always_yes yes --set changeps1 no \
&& /usr/local/miniconda/bin/conda update -q conda \
#&& /usr/local/miniconda/bin/conda install -q conda-env \
&& /usr/local/miniconda/bin/conda create -q -n genrl python=3.6 wheel virtualenv pytest readme_renderer pandas cmake nomkl numpy boost py-boost scipy scikit-learn six joblib \
&& /usr/local/miniconda/bin/conda clean -a \
&& /usr/local/miniconda/bin/conda init \
&& rm miniconda.sh

ENV PATH="/usr/local/miniconda/bin:${PATH}"
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"

RUN /usr/local/miniconda/envs/genrl/bin/python -m pip install -r requirements.txt
&& /usr/local/miniconda/envs/genrl/bin/python -m pip install black isort==4.3.2 flake8 codecov pytest-cov