Micromamba inside Docker container

  docker

I have a base Docker image:

FROM ubuntu:21.04

WORKDIR /app

RUN apt-get update && apt-get install -y wget bzip2 
    && wget -qO-  https://micromamba.snakepit.net/api/micromamba/linux-64/latest | tar -xvj bin/micromamba 
    && touch /root/.bashrc 
    && ./bin/micromamba shell init -s bash -p /opt/conda  
    && cp /root/.bashrc /opt/conda/bashrc 
    && apt-get clean autoremove --yes 
    && rm -rf /var/lib/{apt,dpkg,cache,log}

SHELL ["bash", "-l" ,"-c"]

and derive from it another one:

ARG BASE
FROM $BASE

RUN source /opt/conda/bashrc && micromamba activate 
    && micromamba create --file environment.yaml -p /env

While building the second image I get the following error: micromamba: command not found for the RUN section.

  1. If I run 1st base image manually I can launch micromamba, it is running correctly
  2. I can run temporary image which were created for 2nd image building, micromamba is available via CLI, running correctly.
  3. If I inherit from debian:buster, or alpine, for example, it is building perfectly.

What a problem with the Ubuntu? Why it cannot see micromamba during 2nd Docker image building?

PS using scaffold for building, so it can understand correctly, where is $BASE and what is it.

Source: Docker Questions

LEAVE A COMMENT