our own build-env image
This commit is contained in:
19
Dockerfile
Normal file
19
Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
||||
FROM docker.io/openjdk:jdk-buster
|
||||
|
||||
RUN sed -i 's@deb.debian.org@apt-cache.lan/deb.debian.org@g' /etc/apt/sources.list; \
|
||||
sed -i 's@security.debian.org@apt-cache.lan/security.debian.org@g' /etc/apt/sources.list; \
|
||||
apt update -y; \
|
||||
apt install -y build-essential ccache ecj fastjar file g++ gawk \
|
||||
gettext git java-propose-classpath libelf-dev libncurses5-dev \
|
||||
libncursesw5-dev libssl-dev python python2.7-dev python3 unzip wget \
|
||||
python3-distutils python3-setuptools rsync subversion swig time \
|
||||
xsltproc zlib1g-dev make distcc distcc-pump; \
|
||||
apt-get remove --purge -y exim* && \
|
||||
apt-get autoremove --purge -y && \
|
||||
apt-get clean -y && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
rm -rf /var/cache/apt/* && \
|
||||
ln -sv /usr/lib/distcc-pump/lib/python3.7/site-packages/include_server /usr/lib/distcc-pump/include_server && \
|
||||
rm -v /etc/distcc/hosts
|
||||
|
||||
|
||||
@@ -29,31 +29,9 @@ spec:
|
||||
- name: openwrt-configs
|
||||
type: git
|
||||
steps:
|
||||
- name: setup
|
||||
#image: cr.lan/debian-stable-build-essential
|
||||
image: docker.io/openjdk/jdk-buster
|
||||
script: |
|
||||
#!/usr/bin/env bash
|
||||
#echo 'deb-src http://apt-cache.lan/deb.debian.org/debian testing main' > /etc/apt/sources.list.d/src-testing.list
|
||||
#echo 'deb http://apt-cache.lan/deb.debian.org/debian testing main' > /etc/apt/sources.list.d/testing.list
|
||||
apt update -y
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
echo "HACK openjdk bug"
|
||||
mkdir -p /etc/ssl/certs/java
|
||||
touch /etc/ssl/certs/java/cacerts
|
||||
mkdir -p /usr/share/man/man1
|
||||
touch /usr/share/man/man1/rmid.1.gz.dpkg-tmp
|
||||
echo "////////// HACK openjdk bug"
|
||||
apt install -y ca-certificates-java
|
||||
dpkg --configure -a
|
||||
apt install -y build-essential ccache ecj fastjar file g++ gawk \
|
||||
gettext git java-propose-classpath libelf-dev libncurses5-dev \
|
||||
libncursesw5-dev libssl-dev python python2.7-dev python3 unzip wget \
|
||||
python3-distutils python3-setuptools rsync subversion swig time \
|
||||
xsltproc zlib1g-dev
|
||||
- name: openwrt-get
|
||||
#image: cr.lan/debian-stable-build-essential
|
||||
image: docker.io/openjdk/jdk-buster
|
||||
image: cr.lan/debian-stable-openwrt-build
|
||||
script: |
|
||||
#!/usr/bin/env bash
|
||||
if [ ! -d /usr/src/openwrt ]; then
|
||||
@@ -66,7 +44,7 @@ spec:
|
||||
git pull
|
||||
- name: build-openwrt
|
||||
#image: cr.lan/debian-stable-build-essential
|
||||
image: docker.io/openjdk/jdk-buster
|
||||
image: cr.lan/debian-stable-openwrt-build
|
||||
script: |
|
||||
#!/usr/bin/env bash
|
||||
|
||||
@@ -83,8 +61,10 @@ spec:
|
||||
cp -v $(resources.inputs.openwrt-configs.path)/$(params.config) \
|
||||
/usr/src/openwrt/.config || exit 1
|
||||
cd /usr/src/openwrt
|
||||
./scripts/feeds update -a
|
||||
./scripts/feeds install -a
|
||||
|
||||
ls -la .
|
||||
#./scripts/feeds update -a
|
||||
#./scripts/feeds install -a
|
||||
#distcc-pump make -j20 download world CC=distcc $(params.make_flags)
|
||||
make -j2 download world $(params.make_flags)
|
||||
workspaces:
|
||||
|
||||
75
openwrt-build-image.yaml
Normal file
75
openwrt-build-image.yaml
Normal file
@@ -0,0 +1,75 @@
|
||||
apiVersion: tekton.dev/v1alpha1
|
||||
kind: PipelineResource
|
||||
metadata:
|
||||
name: openwrt-configs-git
|
||||
spec:
|
||||
type: git
|
||||
params:
|
||||
- name: revision
|
||||
value: master
|
||||
- name: url
|
||||
value: http://git-ui.lan/chaos/openwrt-configs.git
|
||||
---
|
||||
apiVersion: tekton.dev/v1alpha1
|
||||
kind: PipelineResource
|
||||
metadata:
|
||||
name: img-debian-stable-openwrt-build
|
||||
spec:
|
||||
type: image
|
||||
params:
|
||||
- name: url
|
||||
value: cr.lan/debian-stable-openwrt-build
|
||||
---
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: Task
|
||||
metadata:
|
||||
name: build-debian-stable-openwrt-build
|
||||
spec:
|
||||
params:
|
||||
- name: pathToContainerFile
|
||||
type: string
|
||||
default: $(resources.inputs.source.path)/Dockerfile
|
||||
- name: pathToContext
|
||||
type: string
|
||||
default: $(resources.inputs.source.path)
|
||||
resources:
|
||||
inputs:
|
||||
- name: source
|
||||
type: git
|
||||
outputs:
|
||||
- name: builtImage
|
||||
type: image
|
||||
steps:
|
||||
- name: build-and-push
|
||||
image: gcr.io/kaniko-project/executor:arm64
|
||||
command:
|
||||
- /kaniko/executor
|
||||
args:
|
||||
- --dockerfile=$(params.pathToContainerFile)
|
||||
- --destination=$(resources.outputs.builtImage.url)
|
||||
- --context=$(params.pathToContext)
|
||||
- --snapshotMode=redo
|
||||
- --skip-tls-verify
|
||||
---
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: TaskRun
|
||||
metadata:
|
||||
name: img-debian-stable-openwrt-build
|
||||
spec:
|
||||
taskRef:
|
||||
name: build-debian-stable-openwrt-build
|
||||
params:
|
||||
- name: pathToContainerFile
|
||||
value: Dockerfile
|
||||
resources:
|
||||
inputs:
|
||||
- name: source
|
||||
resourceRef:
|
||||
name: openwrt-configs-git
|
||||
outputs:
|
||||
- name: builtImage
|
||||
resourceRef:
|
||||
name: img-debian-stable-openwrt-build
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user