forked from bargees/barge-os
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
99 lines (81 loc) · 4.33 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# FROM ailispaw/ubuntu-essential:16.04-nodoc
# ENV TERM=xterm \
# SYSLINUX_SITE=https://mirrors.edge.kernel.org/ubuntu/pool/main/s/syslinux \
# SYSLINUX_VERSION=4.05+dfsg-6+deb8u1
# RUN domain="mirrors.aliyun.com" \
# && echo "deb http://$domain/ubuntu xenial main restricted universe multiverse" > /etc/apt/sources.list \
# && echo "deb http://$domain/ubuntu xenial-security main restricted universe multiverse" >> /etc/apt/sources.list \
# && echo "deb http://$domain/ubuntu xenial-updates main restricted universe multiverse">> /etc/apt/sources.list \
# && echo "deb http://$domain/ubuntu xenial-backports main restricted universe multiverse">> /etc/apt/sources.list
# RUN apt-get -q update && \
# apt-get -q -y install --no-install-recommends ca-certificates \
# bc build-essential cpio file git python unzip rsync wget curl \
# syslinux syslinux-common isolinux xorriso dosfstools mtools && \
# wget -q "${SYSLINUX_SITE}/syslinux-common_${SYSLINUX_VERSION}_all.deb" && \
# wget -q "${SYSLINUX_SITE}/syslinux_${SYSLINUX_VERSION}_amd64.deb" && \
# dpkg -i "syslinux-common_${SYSLINUX_VERSION}_all.deb" && \
# dpkg -i "syslinux_${SYSLINUX_VERSION}_amd64.deb" && \
# rm -f "syslinux-common_${SYSLINUX_VERSION}_all.deb" && \
# rm -f "syslinux_${SYSLINUX_VERSION}_amd64.deb" && \
# apt-get clean && rm -rf /var/cache/apt/* /var/lib/apt/lists/* /var/cache/debconf/* /var/log/*
FROM registry.cn-shenzhen.aliyuncs.com/infrastlabs/barge-build-output:latest as brdata
FROM registry.cn-shenzhen.aliyuncs.com/infrastlabs/barge-build-compiler-ubt1604:latest
# Setup environment
ENV SRC_DIR=/build \
OVERLAY=/overlay \
BR_ROOT=/build/buildroot
RUN mkdir -p ${SRC_DIR} ${OVERLAY}
ENV BR_VERSION 2019.08
# ERROR: The certificate of 'buildroot.org' has expired.
# RUN wget -qO- https://buildroot.org/downloads/buildroot-${BR_VERSION}.tar.bz2 | tar xj && \
# mv buildroot-${BR_VERSION} ${BR_ROOT}
RUN curl -O -fSL -k https://buildroot.org/downloads/buildroot-${BR_VERSION}.tar.bz2
RUN tar -jxf buildroot-${BR_VERSION}.tar.bz2; \
mv buildroot-${BR_VERSION} ${BR_ROOT}
# Apply patches
COPY patches ${SRC_DIR}/patches
RUN for patch in ${SRC_DIR}/patches/*.patch; do \
patch -p1 -d ${BR_ROOT} < ${patch}; \
done
# Setup overlay
COPY overlay ${OVERLAY}
WORKDIR ${OVERLAY}
# Add ca-certificates
RUN mkdir -p etc/ssl/certs && \
cp /etc/ssl/certs/ca-certificates.crt etc/ssl/certs/
# Add bash-completion
RUN mkdir -p usr/share/bash-completion/completions && \
wget -qO usr/share/bash-completion/bash_completion https://ghproxy.com/https://raw.githubusercontent.com/scop/bash-completion/master/bash_completion && \
chmod +x usr/share/bash-completion/bash_completion
# Add Docker bash-completion
ENV DOCKER_VERSION 1.10.3
RUN wget -qO usr/share/bash-completion/completions/docker https://ghproxy.com/https://raw.githubusercontent.com/moby/moby/v${DOCKER_VERSION}/contrib/completion/bash/docker
# Add dumb-init
ENV DINIT_VERSION 1.2.2
RUN mkdir -p usr/bin && \
wget -qO usr/bin/dumb-init https://ghproxy.com/https://github.com/Yelp/dumb-init/releases/download/v${DINIT_VERSION}/dumb-init_${DINIT_VERSION}_amd64 && \
chmod +x usr/bin/dumb-init
ENV VERSION 2.14.0-rc2
RUN mkdir -p etc && \
echo "Welcome to Barge ${VERSION}, Docker version ${DOCKER_VERSION}" > etc/motd && \
echo "NAME=\"Barge\"" > etc/os-release && \
echo "VERSION=${VERSION}" >> etc/os-release && \
echo "ID=barge" >> etc/os-release && \
echo "ID_LIKE=busybox" >> etc/os-release && \
echo "VERSION_ID=${VERSION}" >> etc/os-release && \
echo "PRETTY_NAME=\"Barge ${VERSION}\"" >> etc/os-release && \
echo "HOME_URL=\"https://github.com/bargees/barge-os\"" >> etc/os-release && \
echo "BUG_REPORT_URL=\"https://github.com/bargees/barge-os/issues\"" >> etc/os-release
# Add Package Installer
RUN mkdir -p usr/bin && \
wget -qO usr/bin/pkg https://ghproxy.com/https://raw.githubusercontent.com/bargees/barge-pkg/master/pkg && \
chmod +x usr/bin/pkg
# Copy config files
COPY configs ${SRC_DIR}/configs
RUN cp ${SRC_DIR}/configs/buildroot.config ${BR_ROOT}/.config && \
cp ${SRC_DIR}/configs/busybox.config ${BR_ROOT}/package/busybox/busybox.config
COPY scripts ${SRC_DIR}/scripts
COPY --from=brdata /output/brdata.tar.gz /output_brdata.tar.gz
VOLUME ${BR_ROOT}/dl ${BR_ROOT}/ccache
WORKDIR ${BR_ROOT}
CMD ["../scripts/build.sh"]