diff options
| author | luwenpeng <[email protected]> | 2023-07-03 18:31:22 +0800 |
|---|---|---|
| committer | luwenpeng <[email protected]> | 2023-07-07 09:44:16 +0800 |
| commit | 33d0b4b87b5e4b665340ef7fa1b3f52bd50267dc (patch) | |
| tree | 81f22d51e74f7a465d3319b2d9f17b9cf00a5ffc | |
| parent | 494fd1a57ba181305ef8a19140f7c4366d98a059 (diff) | |
Build DUE Base Imagebase_image_for_due
| -rw-r--r-- | .gitlab-ci.yml | 35 | ||||
| -rw-r--r-- | DUE-4.0.1.tar.gz | bin | 0 -> 202101 bytes | |||
| -rw-r--r-- | Dockerfile | 92 |
3 files changed, 69 insertions, 58 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1fbe7c9..f652404 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,16 +1,37 @@ -image: docker:stable +image: docker:19.03.12 + +stages: + - build-stage1 + - build-stage2 variables: - IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + BASE_IMAGE_FOR_DUE: $CI_REGISTRY_IMAGE:base_image_for_due + DUE_IMAGE_FOR_ONIE: $CI_REGISTRY_IMAGE:due_image_for_onie + DOCKER_HOST: unix:///run/docker.sock before_script: + - env | sort - docker info - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY -build: - stage: build +base_image_for_due: + stage: build-stage1 + script: + - docker build -f Dockerfile -t $BASE_IMAGE_FOR_DUE . + - docker push $BASE_IMAGE_FOR_DUE + tags: + - internal-runner + +due_image_for_onie: + image: $BASE_IMAGE_FOR_DUE + stage: build-stage2 script: - - docker build -t $IMAGE_TAG . - - docker push $IMAGE_TAG + - tar -zxvf /tmp/DUE-4.0.1.tar.gz -C /root/ + - :> /root/DUE-4.0.1/templates/onie/filesystem/etc/apt/sources.list.d/stretch-backports.list + - cd /root/DUE-4.0.1/ && ./due --create --clean + - cd /root/DUE-4.0.1/ && ./due --create --platform linux/amd64 --name onie-build-debian-10 --prompt ONIE-10 --tag onie --use-template onie --from debian:10 --description "ONIE Build Debian 10" + - docker images -a + - docker tag due-onie-build-debian-10:onie git.mesalab.cn:7443/mesa_platform/build-env:due_image_for_onie + - docker push git.mesalab.cn:7443/mesa_platform/build-env:due_image_for_onie tags: - - tsg-os-installer + - internal-runner
\ No newline at end of file diff --git a/DUE-4.0.1.tar.gz b/DUE-4.0.1.tar.gz Binary files differnew file mode 100644 index 0000000..3a1b309 --- /dev/null +++ b/DUE-4.0.1.tar.gz @@ -1,51 +1,41 @@ -# Copyright (C) 2018 Curt Brune <[email protected]> -# -# Modified with permission from Benayak Karki -# -# SPDX-License-Identifier: GPL-2.0 - -FROM debian:9 - -# Add initial development packages -RUN apt-get update && apt-get install -y \ - build-essential stgit u-boot-tools util-linux \ - gperf device-tree-compiler python-all-dev xorriso \ - autoconf automake bison flex texinfo libtool libtool-bin \ - realpath gawk libncurses5 libncurses5-dev bc \ - dosfstools mtools pkg-config git wget help2man libexpat1 \ - libexpat1-dev fakeroot python-sphinx rst2pdf \ - libefivar-dev libnss3-tools libnss3-dev libpopt-dev \ - libssl-dev sbsigntool uuid-runtime uuid-dev cpio \ - bsdmainutils curl sudo -RUN apt install -y python3-pip && \ - pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple httpie && \ - python3 -V - -# Create build user -RUN useradd -m -s /bin/bash build && \ - adduser build sudo && \ - echo "build:build" | chpasswd - -WORKDIR /home/build - -COPY rpm_upload_tools.py /home/build/rpm_upload_tools.py -COPY file_upload_tools_to_share_repo.py /home/build/file_upload_tools_to_share_repo.py -COPY repo.internal.geedge.net.repo /tmp/repo.internal.geedge.net.repo -COPY netrc.conf /home/build/.netrc - -# Add /sbin and /usr/sbin to build user's path -RUN echo export PATH="/sbin:/usr/sbin:\$PATH" >> .bashrc - -# Add common files, like .gitconfig -#COPY home . - -# Create /home/build/src as a mount point for sharing files with the -# host system. -RUN mkdir src - -# Make sure everything in /home/build is owned by the build user -RUN chown -R build:build . - -USER build - -CMD ["/bin/bash", "--login"] +FROM ubuntu:20.04 + +COPY DUE-4.0.1.tar.gz /tmp/DUE-4.0.1.tar.gz + +############################################################################### +# Install Tools +############################################################################### +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && \ + apt-get install -y ca-certificates && \ + apt-get install -y git && \ + apt-get install -y gnupg && \ + apt-get install -y curl && \ + apt-get install -y rsync && \ + apt-get install -y wget && \ + apt-get install -y sudo && \ + apt-get install -y vim && \ + apt-get install -y build-essential + +############################################################################### +# Install Docker: https://docs.docker.com/engine/install/debian/ +############################################################################### +RUN install -m 0755 -d /etc/apt/keyrings && \ + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \ + chmod a+r /etc/apt/keyrings/docker.gpg && \ + echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | tee /etc/apt/sources.list.d/docker.list >/dev/null && \ + apt-get update && \ + apt-get install -y docker-ce && \ + apt-get install -y docker-ce-cli && \ + apt-get install -y containerd.io && \ + apt-get install -y docker-buildx-plugin && \ + apt-get install -y docker-compose-plugin + +############################################################################### +# Usermod For DUE +############################################################################### +RUN /usr/sbin/usermod -a -G docker root + +RUN echo export PATH="/sbin:/usr/sbin:\$PATH" >>.bashrc + +CMD ["/bin/bash", "--login"]
\ No newline at end of file |
