Fix dockerfile error

1. Make "bash" the default shell when building image
2. Add libarchive dependency for centos image
This commit is contained in:
Hui, Chunyang 2021-06-11 02:39:25 +00:00 committed by Zongmin.Gu
parent 67b9c8a173
commit 41bbb3763d
3 changed files with 15 additions and 0 deletions

@ -7,6 +7,10 @@ FROM registry.cn-hangzhou.aliyuncs.com/alinux/aliyunlinux
LABEL maintainer="Chunyang Hui <sanqian.hcy@antgroup.com>" LABEL maintainer="Chunyang Hui <sanqian.hcy@antgroup.com>"
#The default shell for the RUN instruction is ["/bin/sh", "-c"], which sometimes cause unexpected error
#for example "source a_file". Use bash as default shell instead.
SHELL ["/bin/bash", "-c"]
RUN yum install -y --nogpgcheck \ RUN yum install -y --nogpgcheck \
alinux-release-experimentals && \ alinux-release-experimentals && \
yum install -y --nogpgcheck \ yum install -y --nogpgcheck \

@ -7,6 +7,11 @@ FROM centos:8.2.2004
LABEL maintainer="He Sun <bochang.sh@antgroup.com>" LABEL maintainer="He Sun <bochang.sh@antgroup.com>"
#The default shell for the RUN instruction is ["/bin/sh", "-c"], which sometimes cause unexpected error
#for example "source a_file". Use bash as default shell instead.
SHELL ["/bin/bash", "-c"]
# since cmake is updated to 3.18.2-9.el8, it must work with libarchive.
RUN yum install epel-release -y && \ RUN yum install epel-release -y && \
dnf clean all && rm -r /var/cache/dnf && \ dnf clean all && rm -r /var/cache/dnf && \
dnf group install 'Development Tools' -y && \ dnf group install 'Development Tools' -y && \
@ -24,6 +29,7 @@ RUN yum install epel-release -y && \
gmp-devel \ gmp-devel \
golang \ golang \
jq \ jq \
libarchive \
libcurl-devel \ libcurl-devel \
libmpc-devel \ libmpc-devel \
libxml2-devel \ libxml2-devel \

@ -9,6 +9,10 @@ FROM ubuntu:18.04
LABEL maintainer="Qing Li <geding.lq@antgroup.com>" LABEL maintainer="Qing Li <geding.lq@antgroup.com>"
#The default shell for the RUN instruction is ["/bin/sh", "-c"], which sometimes cause unexpected error
#for example "source a_file". Use bash as default shell instead.
SHELL ["/bin/bash", "-c"]
RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \ RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
alien \ alien \
astyle \ astyle \
@ -160,6 +164,7 @@ ARG OCCLUM_BRANCH
WORKDIR /root WORKDIR /root
RUN git clone -b $OCCLUM_BRANCH https://github.com/occlum/occlum && \ RUN git clone -b $OCCLUM_BRANCH https://github.com/occlum/occlum && \
cd occlum && \ cd occlum && \
source /opt/intel/sgxsdk/environment && \
make submodule && \ make submodule && \
OCCLUM_RELEASE_BUILD=1 make && \ OCCLUM_RELEASE_BUILD=1 make && \
make install && \ make install && \