Skip to content

Commit

Permalink
Reduce size of the final GSC image
Browse files Browse the repository at this point in the history
  • Loading branch information
amathew3 committed Apr 10, 2023
1 parent a0bb1f5 commit 8266169
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
11 changes: 7 additions & 4 deletions templates/centos/Dockerfile.build.template
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ RUN dnf update -y \
python3-pip \
python3-protobuf \
&& /usr/bin/python3 -B -m pip install click jinja2 protobuf \
'tomli>=1.1.0' 'tomli-w>=0.4.0'

'tomli>=1.1.0' 'tomli-w>=0.4.0' \
&& dnf repolist \
# For compatibility with Gramine v1.3 or lower
RUN /usr/bin/python3 -B -m pip install 'toml>=0.10'
&& /usr/bin/python3 -B -m pip install 'toml>=0.10' \
&& dnf install -y python3-pyelftools \
&& rpm -e --nodeps python3-pip && dnf -y clean all \
&& rm -rf /var/cache/dnf/* \
&& rm -rf /var/lib/dnf/system-upgrade/*

# Install pyelftools after the installation of epel-release as it is provided by the EPEL repo
RUN dnf install -y python3-pyelftools

{% if debug %}
RUN dnf install -y \
Expand Down
13 changes: 6 additions & 7 deletions templates/debian/Dockerfile.build.template
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ RUN apt-get update \
python3-protobuf \
python3-pyelftools \
&& /usr/bin/python3 -B -m pip install click jinja2 protobuf \
'tomli>=1.1.0' 'tomli-w>=0.4.0'

'tomli>=1.1.0' 'tomli-w>=0.4.0' \
# For compatibility with Gramine v1.3 or lower
RUN /usr/bin/python3 -B -m pip install 'toml>=0.10'
&& /usr/bin/python3 -B -m pip install 'toml>=0.10' \
&& locale-gen en_US.UTF-8 \
&& apt remove -y python3-pip locales locales-all && apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*


{% if debug %}
RUN env DEBIAN_FRONTEND=noninteractive apt-get install -y \
Expand All @@ -31,8 +34,4 @@ RUN env DEBIAN_FRONTEND=noninteractive apt-get install -y \
vim
{% endif %}

RUN locale-gen en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
{% endblock %}

0 comments on commit 8266169

Please sign in to comment.