diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4f27459f2..627f0a9fb 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -66,6 +66,7 @@ jobs: echo ::set-output name=docker_image::${DOCKER_IMAGE} echo ::set-output name=version::${VERSION} echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} \ + --build-arg OT_GIT_REF=${{ github.sha }} \ --build-arg VERSION=${VERSION} \ --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \ --build-arg VCS_REF=${GITHUB_SHA::8} \ diff --git a/etc/docker/codelab_otsim/Dockerfile b/etc/docker/codelab_otsim/Dockerfile index 298231433..9f9999212 100644 --- a/etc/docker/codelab_otsim/Dockerfile +++ b/etc/docker/codelab_otsim/Dockerfile @@ -2,6 +2,7 @@ FROM ubuntu:18.04 ENV DEBIAN_FRONTEND noninteractive +ARG OT_GIT_REF=main # Install dependencies: RUN apt-get update -qq @@ -12,10 +13,11 @@ RUN apt-get --no-install-recommends install -y git sudo software-properties-comm && update-ca-certificates # Install OpenThread -RUN mkdir -p ~/src && \ - cd ~/src && \ - git clone --recursive https://github.com/openthread/openthread.git && \ - cd openthread && \ +RUN mkdir -p ~/src/openthread && \ + cd ~/src/openthread && \ + git init . && \ + git fetch https://github.com/openthread/openthread.git ${OT_GIT_REF} && \ + git checkout FETCH_HEAD && \ ./script/bootstrap && \ ./bootstrap && \ make -f examples/Makefile-simulation