content: # Copyright (C) 2023  C-PAC Developers
  
  # This file is part of C-PAC.
  
  # C-PAC is free software: you can redistribute it and/or modify it under
  # the terms of the GNU Lesser General Public License as published by the
  # Free Software Foundation, either version 3 of the License, or (at your
  # option) any later version.
  
  # C-PAC is distributed in the hope that it will be useful, but WITHOUT
  # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  # License for more details.
  
  # You should have received a copy of the GNU Lesser General Public
  # License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
  FROM ghcr.io/fcp-indi/c-pac/ubuntu:jammy-non-free as c3d
  USER root
  
  # Installing and setting up c3d
  COPY dev/docker_data/checksum/c3d.1.0.0.sha384 /tmp/checksum.sha384
  RUN mkdir -p /opt/c3d && \
      curl -sSL "http://downloads.sourceforge.net/project/c3d/c3d/1.0.0/c3d-1.0.0-Linux-x86_64.tar.gz" -o /tmp/c3d.tar.gz \
      && sha384sum --check /tmp/checksum.sha384 \
      && tar -xzC /opt/c3d --strip-components 1 -f /tmp/c3d.tar.gz
  ENV C3DPATH /opt/c3d
  ENV PATH $C3DPATH/bin:$PATH
  
  ENTRYPOINT ["/bin/bash"]
  
  # Link libraries for Singularity images
  RUN ldconfig
  
  RUN apt-get clean && \
      apt-get autoremove -y && \
      rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  
  FROM scratch
  LABEL org.opencontainers.image.description "NOT INTENDED FOR USE OTHER THAN AS A STAGE IMAGE IN A MULTI-STAGE BUILD \
  c3d 1.0.0 (Jammy) stage"
  LABEL org.opencontainers.image.source https://github.com/FCP-INDI/C-PAC
  COPY --from=c3d /opt/c3d/ /opt/c3d/
  