首页 > 其他分享 >构建icecream

构建icecream

时间:2022-10-26 03:11:13浏览次数:79  
标签:RUN -- dev 8765 icecream 构建 apt

文档说明:只记录关键地方;
试验环境: linux debian 11
目标:构建能用于并行编译的容器环境

Icecream 是由 SUSE 创建的、基于 distcc 的并行编译工具
分布式编译工具(充分利用多台计算机的编译能力)

构建脚本

#!/bin/bash
set -eux
day=$(date "+%Y%m%d%H%M")
day=$(date -u +"%Y%m%dT%H%MZ")
export DOCKER_BUILDKIT=1

image="registry.cn-beijing.aliyuncs.com/jingjingxyk-public/app:icecream-debian-11-$day"

PROXY_URL=${2:+'http://192.168.3.26:8015'}
 
# 要使用代理,需要传递两个参数
# sh build-docker.sh --proxy 1

docker build -t $image   -f Dockerfile .  --progress=plain  --build-arg PROXY_URL=$PROXY_URL  # --no-cache

docker push $image


Dockerfile


FROM alpine:latest
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
RUN apk update
RUN apk add git curl

ARG  PROXY_URL
ENV  http_proxy=$PROXY_URL
ENV  https_proxy=$PROXY_URL

RUN git clone --depth=1 --progress https://github.com/JPEWdev/icecream-sundae.git
RUN git clone --depth=1 --progress https://github.com/icecc/icecream.git
ENV  http_proxy=''
ENV  https_proxy=''


FROM debian:11 AS builder

RUN test ! -f /etc/apt/source.list.save && cp  /etc/apt/sources.list /etc/apt/sources.list.save
RUN  sed -i "s@security.ubuntu.com@mirrors.ustc.edu.cn@g" /etc/apt/sources.list 
RUN  sed -i "s@archive.ubuntu.com@mirrors.ustc.edu.cn@g" /etc/apt/sources.list

RUN  apt update -y && apt install -y ca-certificates
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN  apt install -y  libcap-ng-dev liblzo2-dev libzstd-dev libarchive-dev asciidoc automake \
libtool gcc g++ clang \
libcap-ng-dev pkg-config \
make tini  libssl-dev ca-certificates  make cmake gcc g++ zip \
python3 python3-pip python3-dev wget ninja-build

RUN  apt-get install -y  g++ libcap-ng-dev libglib2.0-dev libicecc-dev liblzo2-dev libncursesw5-dev meson ninja-build

COPY --from=0 /icecream /icecream
COPY --from=0 /icecream-sundae /icecream-sundae

WORKDIR /icecream
RUN ./autogen.sh &&  ./configure --prefix=/opt/icecream &&   make -j `grep "processor" /proc/cpuinfo | sort -u | wc -l` &&  make install
ENV PATH=/opt/icecream/libexec/icecc/bin:/opt/icecream/bin:/opt/icecream/sbin:$PATH
EXPOSE 10245 8765 8766

WORKDIR /icecream-sundae
RUN mkdir builddir
WORKDIR /icecream-sundae/builddir
RUN meson .. --buildtype release
RUN ninja  && ninja install
WORKDIR /
RUN apt autoclean && apt clean && rm -rf  /icecream /icecream-sundae
ENTRYPOINT ["tini", "--"]
# CMD icecc-scheduler -u nobody -v
# CMD ['/bin/sh','-c','icecc-scheduler -u nobody']


#CMD在容器运行的时候提供一些命令及参数,用法如下:
#CMD ["executable","param1","param2"] (exec form, this is the preferred form)
#CMD ["param1","param2"] (as default parameters to ENTRYPOINT)
#CMD command param1 param2 (shell form)
#第一种用法:运行一个可执行的文件并提供参数。
#第二种用法:为ENTRYPOINT指定参数。
#第三种用法(shell form):是以”/bin/sh -c”的方法执行的命令。



配置简述

# 调度节点
/opt/icecream/sbin/icecc-scheduler -d -u nobody
# 监控命令
monitor:  icecream-sundae
# 必要的端口
- 10245:10245/tcp 
- 8765:8765/tcp 
- 8766:8766/tcp 
- 8765:8765/udp

# 执行任务节点
/opt/icecream/sbin/iceccd -u nobody -d -s 192.168.3.32:8765

端口说明


守护进程计算机上的 TCP/10245(必需)
用于调度程序计算机的 TCP/8765(必需)
TCP/8766 用于调度程序的 telnet 接口(可选)
UDP/8765 用于广播以查找调度程序(可选)

例子: 调度节点

version: "3"
services:
    icecream-scheduler:
        image:   registry-vpc.cn-beijing.aliyuncs.com/jingjingxyk-public/app:icecream-debian-11-20220524T1607Z
        ports:
        - "10245:10245/tcp"
        - "8765:8765/tcp"
        - "8766:8766/tcp"
        - "8765:8765/udp"
        hostname: icecream-ubuntu-scheduler-01
        command:
            - /bin/sh
            - -c
            - |
                icecc-scheduler -d -u nobody
                tail -f /dev/null

例子:任务节点

version: "3"
services:
    icecream-worker:
        image:   registry-vpc.cn-beijing.aliyuncs.com/jingjingxyk-public/app:icecream-debian-11-20220524T1607Z
        ports:
        - "8765:8765/tcp"
        - "8766:8766/tcp"
        - "8765:8765/udp"
        hostname: icecream-ubuntu-worker-01  # 172.23.24.221 调度节点IP
        command:
            - /bin/sh
            - -c
            - |
                /opt/icecream/sbin/iceccd -u nobody -d -s 172.23.24.221:8765
                tail -f /dev/null

参考文档

  1. icecream
  2. icecream-sundae
  3. shell之变量默认值
  4. Dockerfile
  5. Compose file

标签:RUN,--,dev,8765,icecream,构建,apt
From: https://www.cnblogs.com/jingjingxyk/p/16827000.html

相关文章

  • 构建quic_server
    文档说明:只记录关键地方;试验环境:linuxdebian11目标:构建能测试的quicserver下载chromium并且安装好依赖以后,执行脚本#!/bin/bashset-exu__CURRENT__=`pwd`......
  • 构建容器版coturn
    文档说明:只记录关键地方;试验环境:linuxdebian11目标:构建能启动的coturncoturn服务器完整的实现了STUN/TURN/ICE协议基础环境:docker构建脚本build-docker.......
  • 构建容器版Janus WebRTC server
    文档说明:只记录关键地方;试验环境:linuxdebian11目标:构建能启动的JanusWebRTCserver基础环境:docker构建脚本build-docker.sh#!/bin/envbashset-eexport......
  • 构建能让socat支持TLSv.13的容器环境
    文档说明:只记录关键地方;试验环境:linuxdebian11目标socat支持TLSv1.3dockerfileFROMalpine:latestRUNtest-f/etc/apk/repositories.save||cp/etc/apk/repo......
  • 构建一个神经网络
    importtensorflowastfimportnumpyasnpdefadd_layer(inputs,in_size,out_size,activation_function=None):#inputs是输入的值,in_size输入值的大小,out_size输......
  • Docker构建PHP8.
    容器DockerfileFROMphp:8.1-fpm-alpine3.16RUNechohttps://mirrors.ustc.edu.cn/alpine/v3.16/main>/etc/apk/repositories&&\echohttps://mirrors.ustc.edu.......
  • 构建 Flutter 应用程序的10个最佳 VSCode 插件
    构建Flutter应用程序的10个最佳VSCode插件在本文中,我们将分享使用VisualStudio代码(VSCode)IDE的经验。我们的开发团队更喜欢使用某些插件,这里我们将解释原因......
  • Struts2-3环境准备以及构建第一个Struts2-3的hello-word项目
    MyEclipse8.6下载MyEclipse8.6下载地址链接:https://pan.baidu.com/s/1XABCEUwg6NLNThgniAA1mQ,请发邮件至youweics@163.com获取提取码以及破解教程struts2.3下载h......
  • Struts2-3环境准备以及构建第一个Struts2-3的hello-word项目
    MyEclipse8.6下载MyEclipse8.6下载地址链接:https://pan.baidu.com/s/1XABCEUwg6NLNThgniAA1mQ,请发邮件至youweics@163.com获取提取码以及破解教程struts2.3下载h......
  • Struts2-3环境准备以及构建第一个Struts2-3的hello-word项目
    MyEclipse8.6下载MyEclipse8.6下载地址链接:https://pan.baidu.com/s/1XABCEUwg6NLNThgniAA1mQ,请发邮件至youweics@163.com获取提取码以及破解教程struts2.3下载h......