added a workflow to build and push CI runner docker image (#28539)
This commit is contained in:
20
.github/workflows/publish-ci-docker-image.yml
vendored
Normal file
20
.github/workflows/publish-ci-docker-image.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
name: Push CI Runner Docker Image
|
||||
|
||||
on: workflow_dispatch
|
||||
jobs:
|
||||
push:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build and Push docker image
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
run : |
|
||||
docker build -f .ci/Dockerfile
|
||||
docker tag openedx/edx-platform-ci-runner
|
||||
make docker_auth
|
||||
docker push 'openedx/edx-platform-ci-runner:latest'
|
||||
56
scripts/ci-runner.Dockerfile
Normal file
56
scripts/ci-runner.Dockerfile
Normal file
@@ -0,0 +1,56 @@
|
||||
FROM summerwind/actions-runner:v2.278.0-ubuntu-20.04 as base
|
||||
|
||||
USER root
|
||||
|
||||
# Install system requirements
|
||||
RUN apt-get update && \
|
||||
# Global requirements
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
build-essential git language-pack-en libmysqlclient-dev libssl-dev libxml2-dev \
|
||||
libxmlsec1-dev libxslt1-dev \
|
||||
# lynx: Required by https://github.com/edx/edx-platform/blob/b489a4ecb122/openedx/core/lib/html_to_text.py#L16
|
||||
lynx xvfb pkg-config \
|
||||
python3-dev python3-venv \
|
||||
mongodb\
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN locale-gen en_US.UTF-8
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LANGUAGE en_US:en
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
|
||||
WORKDIR /edx/app/edxapp/edx-platform
|
||||
|
||||
ENV PATH /edx/app/edxapp/nodeenv/bin:${PATH}
|
||||
ENV PATH ./node_modules/.bin:${PATH}
|
||||
ENV CONFIG_ROOT /edx/etc/
|
||||
ENV PATH /edx/app/edxapp/edx-platform/bin:${PATH}
|
||||
ENV SETTINGS production
|
||||
RUN mkdir -p /edx/etc/
|
||||
|
||||
ENV VIRTUAL_ENV=/edx/app/edxapp/venvs/edxapp
|
||||
RUN python3.8 -m venv $VIRTUAL_ENV
|
||||
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||
|
||||
|
||||
FROM base as build
|
||||
|
||||
# Install Python requirements
|
||||
COPY setup.py setup.py
|
||||
COPY common/lib/ common/lib/
|
||||
COPY openedx/core/lib openedx/core/lib
|
||||
COPY lms lms
|
||||
COPY cms cms
|
||||
COPY requirements/pip.txt requirements/pip.txt
|
||||
COPY requirements/edx/testing.txt requirements/edx/testing.txt
|
||||
COPY requirements/edx/django.txt requirements/edx/django.txt
|
||||
RUN pip install -r requirements/pip.txt && \
|
||||
pip install -r requirements/edx/testing.txt -r requirements/edx/django.txt
|
||||
|
||||
FROM base as runner
|
||||
|
||||
COPY --from=build /edx/app/edxapp/venvs/edxapp /edx/app/edxapp/venvs/edxapp
|
||||
|
||||
USER runner
|
||||
|
||||
CMD ["/entrypoint.sh"]
|
||||
Reference in New Issue
Block a user