0

Can somebody help me?
Sorry for the long question but I'm trying to describe my issue in as much detail as possible.
I'm trying to have a software that installed in my docker image.

  • In the below image, at number 2, you can see I COPY ace/ /tmp/ - ace/ is a directory that contains my software installer. In the dockerfile, I already remove /tmp/ folder after the installation has been completed.
    The question is How can I reduce the size of the layer used for COPY the installer from docker context to /tmp/.
  • Meanwhile, you can see, at number 1, something similar with number 2, but it's size has been reduced, the actual size of repo/ is 1 Gb. I don't know what is the difference here

Info about layers

My dockerfile:

FROM ubuntu:18.04
RUN apt-get update && apt-get install -y \
        python3.6 python3-venv  
COPY ace/ /tmp/
RUN /bin/bash -c ' \
    Some commands to install ace from /tmp/ such as: apt install -y /tmp/*.deb;
    rm -r /tmp/*'
COPY repo/ /tmp/
RUN /bin/bash -c ' \
    Some commands to install environment from /tmp/ such as: /tmp/setup_venv.sh;
    rm -r /tmp/*'
Huy Nguyen
  • 31
  • 1
  • 5
  • I can't really see what's going on in that image. Can you edit the question to include a [mcve], with a sample Dockerfile you're trying to optimize, as text and not an image? – David Maze Jul 29 '21 at 10:53
  • Thank you for your suggestion. I have edited my question. You can look at number 2 in the image, I want to remove this layer, or at least reduce the size of this. – Huy Nguyen Jul 29 '21 at 12:12

0 Answers0