From 5d2670a0ab9b11bfb045991c797677515e9aa21b Mon Sep 17 00:00:00 2001 From: luocai Date: Fri, 9 Dec 2022 13:49:27 +0800 Subject: [PATCH] add mkdocs dockerfile. --- .drone.yml | 14 ++++++++++++ jenkins.dockerfile | 54 ++++++++++++++++++++++++++++++++++++++++++++++ jieli.dockerfile | 18 ++++++++++++++++ mkdocs.dockerfile | 11 ++++++++++ 4 files changed, 97 insertions(+) create mode 100644 .drone.yml create mode 100644 jenkins.dockerfile create mode 100644 jieli.dockerfile create mode 100644 mkdocs.dockerfile diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..f78563a --- /dev/null +++ b/.drone.yml @@ -0,0 +1,14 @@ +kind: pipeline +type: docker +name: docker-build +steps: +- name: deploy-mkdocs + image: plugins/docker + settings: + registry: registry.cn-shenzhen.aliyuncs.com + repo: registry.cn-shenzhen.aliyuncs.com/amass_toolset/develop + tags: mkdocs + dockerfile: mkdocs.dockerfile + username: 168062547@qq.com + password: + from_secret: docker_password \ No newline at end of file diff --git a/jenkins.dockerfile b/jenkins.dockerfile new file mode 100644 index 0000000..eda8631 --- /dev/null +++ b/jenkins.dockerfile @@ -0,0 +1,54 @@ +FROM registry.cn-shenzhen.aliyuncs.com/amass_toolset/jl_develop:latest +LABEL maintainer 168062547@qq.com + +ARG user=jenkins +ARG group=jenkins +ARG uid=1000 +ARG gid=1000 +# ARG http_port=8080 +# ARG agent_port=50000 + +ENV JENKINS_HOME /var/jenkins_home +ENV JENKINS_SLAVE_AGENT_PORT ${agent_port} + + +RUN groupadd -g ${gid} ${group} \ + && useradd -d "$JENKINS_HOME" -u ${uid} -g ${gid} -m -s /bin/bash ${user} +RUN chown -R ${user} "$JENKINS_HOME" + +RUN curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | tee \ + /usr/share/keyrings/jenkins-keyring.asc > /dev/null +RUN echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ + https://pkg.jenkins.io/debian-stable binary/ | tee \ + /etc/apt/sources.list.d/jenkins.list > /dev/null + +RUN mkdir -p /etc/apt/keyrings +RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg +RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ + $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null + +RUN apt-get update +RUN apt-get install -y jenkins openjdk-11-jre docker-ce-cli python2 + +ENV TINI_VERSION 0.19.0 +ENV TINI_SHA c5b0666b4cb676901f90dfcb37106783c5fe2077b04590973b885950611b30ee + +# Use tini as subreaper in Docker container to adopt zombie processes +RUN curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-static-amd64 -o /sbin/tini && chmod +x /sbin/tini \ + && echo "$TINI_SHA /sbin/tini" | sha256sum -c - + +RUN wget https://bootstrap.pypa.io/pip/2.7/get-pip.py +RUN python2 ./get-pip.py +RUN update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 +RUN pip2 install pyyaml python-jenkins -i https://mirrors.aliyun.com/pypi/simple/ + +VOLUME /var/jenkins_home +USER ${user} +ENTRYPOINT ["/sbin/tini", "--", "jenkins"] + +# docker build -t jl_jenkins . +# docker run -p 8080:8080 -p 50000:50000 --rm -d --volume jenkins-data:/var/jenkins_home registry.cn-shenzhen.aliyuncs.com/amass_toolset/jl_develop:jenkins + +# docker tag d97263da6c6f registry.cn-shenzhen.aliyuncs.com/amass_toolset/jl_develop:jenkins +# docker push registry.cn-shenzhen.aliyuncs.com/amass_toolset/jl_develop:jenkins +# docker run --rm -it registry.cn-shenzhen.aliyuncs.com/amass_toolset/jl_develop:latest \ No newline at end of file diff --git a/jieli.dockerfile b/jieli.dockerfile new file mode 100644 index 0000000..865b773 --- /dev/null +++ b/jieli.dockerfile @@ -0,0 +1,18 @@ +FROM ubuntu:20.04 +LABEL maintainer 168062547@qq.com +ENV DEBIAN_FRONTEND=noninteractive +RUN sed -i "s@http://.*archive.ubuntu.com@http://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list +RUN sed -i "s@http://.*security.ubuntu.com@http://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list +RUN apt-get update +RUN apt-get install -y make software-properties-common wget git vim ninja-build pkg-config \ + libssl-dev libcurl4-openssl-dev zip unzip curl +RUN apt-get install -y locate gcc g++ + +ADD jieli.tar.gz /opt/ + +ENV LANG C.UTF-8 + +# docker build -t jl_develop . +# docker tag 5af7a94548a7 registry.cn-shenzhen.aliyuncs.com/amass_toolset/jl_develop:latest +# docker push registry.cn-shenzhen.aliyuncs.com/amass_toolset/jl_develop:latest +# docker run --rm -it registry.cn-shenzhen.aliyuncs.com/amass_toolset/jl_develop:latest diff --git a/mkdocs.dockerfile b/mkdocs.dockerfile new file mode 100644 index 0000000..1f87681 --- /dev/null +++ b/mkdocs.dockerfile @@ -0,0 +1,11 @@ +FROM ubuntu:22.04 +LABEL maintainer 168062547@qq.com +ENV DEBIAN_FRONTEND=noninteractive +RUN sed -i "s@http://.*archive.ubuntu.com@http://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list && \ + sed -i "s@http://.*security.ubuntu.com@http://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list && \ + apt-get update +RUN apt-get install -y --no-install-recommends vim python3 pip +RUN pip install mkdocs mkdocs-material -i https://pypi.tuna.tsinghua.edu.cn/simple + + +# docker build -f mkdocs.dockerfile -t mkdocs . \ No newline at end of file