I am new to Docker and am trying to cut corners in building Docker images. I heard that Coiled could be used to generate Docker images from Conda environment yamls. I have done this, but now I would like to be able to go from this image to a Docker file.
I use the code snippet from this post to generate a Dockerfile from the image.
sudo docker history [image_id_or_name] --no-trunc $argv | tac | tr -s ' ' | cut -d " " -f 5- | sed 's,^/bin/sh -c #(nop) ,,g' | sed 's,^/bin/sh -c,RUN,g' | sed 's, && ,\n & ,g' | sed 's,\s*[0-9]*[\.]*[0-9]*[kMG]*B\s*$,,g' | head -n -1
I get this result. So my question is, can this be used with docker build to rebuild the image, or does the fact that this image was made with Coiled mean this is not possible?
ADD file:d2abb0e4e7ac1773741f51f57d3a0b8ffc7907348842d773f8c341ba17f856d5 in /
CMD ["bash"]
LABEL MAINTAINER=Anaconda, Inc
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
RUN apt-get update -q
&& apt-get install -q -y bzip2 ca-certificates git libglib2.0-0 libsm6 libxext6 libxrender1 mercurial subversion wget
&& apt-get clean
ENV PATH=/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
CMD ["/bin/bash"]
ARG CONDA_VERSION=py38_4.9.2
ARG CONDA_MD5=122c8c9beb51e124ab32a0fa6426c656
|2 CONDA_MD5=122c8c9beb51e124ab32a0fa6426c656 CONDA_VERSION=py38_4.9.2 /bin/sh -c wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh -O miniconda.sh
&& echo "${CONDA_MD5} miniconda.sh" > miniconda.md5
&& if ! md5sum --status -c miniconda.md5; then exit 1; fi
&& mkdir -p /opt
&& sh miniconda.sh -b -p /opt/conda
&& rm miniconda.sh miniconda.md5
&& ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh
&& echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc
&& echo "conda activate base" >> ~/.bashrc
&& find /opt/conda/ -follow -type f -name '*.a' -delete
&& find /opt/conda/ -follow -type f -name '*.js.map' -delete
&& /opt/conda/bin/conda clean -afy
RUN apt-get update --fix-missing
&& apt-get install -y build-essential curl
&& apt-get clean
&& rm -rf /var/lib/apt/lists/*
COPY file:8fbc74e60bc7b14cf283619ce5f38b80e56eab23f93fceaef50bdc8acbce3e87 in environment.yml
RUN conda env update -n coiled -f environment.yml
&& rm environment.yml
&& conda clean --all -y
&& echo "conda activate coiled" >> ~/.bashrc
ENV PATH /opt/conda/envs/coiled/bin:$PATH
SHELL ["conda", "run", "-n", "coiled", "/bin/bash", "-c"]