Skip to content

Commit

Permalink
add docker image for Lidro
Browse files Browse the repository at this point in the history
  • Loading branch information
yoann-apel committed Sep 25, 2024
1 parent b2e712b commit 9193848
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM mambaorg/micromamba:latest

USER root

WORKDIR /lidro

# # Set up the Conda environment: cf https://github.com/mamba-org/micromamba-docker
COPY environment.yml /tmp/env.yaml
COPY requirements.txt /tmp/requirements.txt
RUN chown $MAMBA_USER:$MAMBA_USER /tmp/env.yaml
RUN micromamba install -y -n base -f /tmp/env.yaml && \
micromamba clean --all --yes

ENV ENV=base
ARG MAMBA_DOCKERFILE_ACTIVATE=1


COPY lidro lidro
COPY configs configs
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Makefile to manage main tasks
# cf. https://blog.ianpreston.ca/conda/python/bash/2020/05/13/conda_envs.html#makefile

# Oneshell means I can run multiple lines in a recipe in the same shell, so I don't have to
# chain commands together with semicolon
.ONESHELL:
SHELL = /bin/bash
install:
pip install -e .

install-precommit:
pre-commit install

mamba-env-create:
mamba env create -n lidro -f environment.yml

mamba-env-update:
mamba env update -n lidro -f environment.yml

##############################
# Docker
##############################

PROJECT_NAME=lidar_hd/lidro
VERSION=`python -m lidro._version`

docker-build:
docker build -t ${PROJECT_NAME}:${VERSION} -f Dockerfile .

docker-remove:
docker rmi -f `docker images | grep ${PROJECT_NAME} | tr -s ' ' | cut -d ' ' -f 3`
docker rmi -f `docker images -f "dangling=true" -q`

0 comments on commit 9193848

Please sign in to comment.