Add support for building docker image with specific Occlum branch
This commit is contained in:
parent
4769a2600e
commit
9c3f595f0e
@ -29,6 +29,11 @@ jobs:
|
||||
id: get_version
|
||||
run: echo "RELEASE_VERSION=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV;
|
||||
|
||||
- name: Get branch name
|
||||
# GITHUB_REF=refs/heads/branch-name
|
||||
# ${GITHUB_REF##*/} == branch-name
|
||||
run: echo "OCCLUM_BRANCH=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV;
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
|
||||
@ -47,6 +52,7 @@ jobs:
|
||||
context: .
|
||||
file: ./tools/docker/Dockerfile.centos8.1
|
||||
platforms: linux/amd64
|
||||
build-args: OCCLUM_BRANCH=${{ env.OCCLUM_BRANCH }}
|
||||
push: true
|
||||
tags: occlum/occlum:${{ env.RELEASE_VERSION }}-centos8.1
|
||||
|
||||
@ -69,6 +75,11 @@ jobs:
|
||||
id: get_version
|
||||
run: echo "RELEASE_VERSION=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV;
|
||||
|
||||
- name: Get branch name
|
||||
# GITHUB_REF=refs/heads/branch-name
|
||||
# ${GITHUB_REF##*/} == branch-name
|
||||
run: echo "OCCLUM_BRANCH=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV;
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
|
||||
@ -87,5 +98,6 @@ jobs:
|
||||
context: .
|
||||
file: ./tools/docker/Dockerfile.ubuntu18.04
|
||||
platforms: linux/amd64
|
||||
build-args: OCCLUM_BRANCH=${{ env.OCCLUM_BRANCH }}
|
||||
push: true
|
||||
tags: occlum/occlum:${{ env.RELEASE_VERSION }}-ubuntu18.04
|
||||
|
@ -96,8 +96,9 @@ RUN cd java && ./install_dragonwell.sh && rm -rf /tmp/java
|
||||
ENV PATH="/opt/occlum/toolchains/jvm/bin:$PATH"
|
||||
|
||||
# Install the latest version of Occlum
|
||||
ARG OCCLUM_BRANCH
|
||||
WORKDIR /root
|
||||
RUN git clone https://github.com/occlum/occlum.git && \
|
||||
RUN git clone -b $OCCLUM_BRANCH https://github.com/occlum/occlum && \
|
||||
cd occlum && \
|
||||
source /root/.bashrc && \
|
||||
make submodule && \
|
||||
|
@ -108,8 +108,9 @@ RUN cd java && ./install_dragonwell.sh && rm -rf /tmp/java
|
||||
ENV PATH="/opt/occlum/toolchains/jvm/bin:$PATH"
|
||||
|
||||
# Install the latest version of Occlum
|
||||
ARG OCCLUM_BRANCH
|
||||
WORKDIR /root
|
||||
RUN git clone https://github.com/occlum/occlum && \
|
||||
RUN git clone -b $OCCLUM_BRANCH https://github.com/occlum/occlum && \
|
||||
cd occlum && \
|
||||
make submodule && \
|
||||
OCCLUM_RELEASE_BUILD=1 make && \
|
||||
|
@ -34,6 +34,7 @@ if [[ ( "$#" < 2 ) ]] ; then
|
||||
report_error
|
||||
fi
|
||||
|
||||
occlum_branch=master
|
||||
occlum_label=$1
|
||||
os_name=$2
|
||||
|
||||
@ -46,4 +47,4 @@ function check_item_in_list() {
|
||||
check_item_in_list "$os_name" "ubuntu18.04 centos7.5 centos8.1" || report_error
|
||||
|
||||
cd "$script_dir/.."
|
||||
docker build -f "$script_dir/Dockerfile.$os_name" -t "occlum/occlum:$occlum_label-$os_name" .
|
||||
docker build -f "$script_dir/Dockerfile.$os_name" -t "occlum/occlum:$occlum_label-$os_name" --build-arg OCCLUM_BRANCH=$occlum_branch .
|
||||
|
Loading…
Reference in New Issue
Block a user