File tree 7 files changed +26
-2
lines changed
7 files changed +26
-2
lines changed Original file line number Diff line number Diff line change
1
+ openwrt.conf
2
+ .env
3
+ * .img.gz
4
+ * .img
5
+ etc /config /*
6
+ ! etc /config /* .tpl
Original file line number Diff line number Diff line change 1
1
openwrt.conf
2
2
.env
3
3
* .tar.gz
4
+ * .img
5
+ * .img.gz
4
6
etc /config /*
5
7
! etc /config /* .tpl
Original file line number Diff line number Diff line change 40
40
- cp openwrt.conf.example openwrt.conf
41
41
- sed -i -E "s@(BUILD_TAG=).+@\1$CI_IMAGE@" openwrt.conf
42
42
- wget -qO- $SRC_IMAGE | gzip -d > image.img
43
- - source openwrt.conf
44
- - export ROOT_PW; export BUILD_TAG; export LOOP_ARGS="=/tmp/dev/loop0"; ./build-rpi.sh
43
+ - LOOP_ARGS="=/tmp/dev/loop0" ./build-rpi.sh
45
44
- docker tag $CI_IMAGE $CI_IMAGE:$TAG
46
45
- docker push $CI_IMAGE:$TAG
47
46
@@ -61,6 +60,7 @@ build-rpi4:
61
60
extends : .build-rpi
62
61
variables :
63
62
SRC_IMAGE : https://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/openwrt-bcm27xx-bcm2711-rpi-4-ext4-factory.img.gz
63
+ VERSION : snapshot
64
64
TAG : rpi4
65
65
66
66
build-rpi-zero :
Original file line number Diff line number Diff line change @@ -18,4 +18,10 @@ RUN opkg remove dnsmasq && \
18
18
RUN opkg list-upgradable | awk '{print $1}' | xargs opkg upgrade
19
19
RUN echo "iptables -A POSTROUTING -t mangle -p udp --dport 68 -j CHECKSUM --checksum-fill" >> /etc/firewall.user
20
20
21
+ ARG ts
22
+ ARG version
23
+ LABEL org.opencontainers.image.created=$ts
24
+ LABEL org.opencontainers.image.version=$version
25
+ LABEL org.opencontainers.image.source=https://github.com/oofnikj/docker-openwrt
26
+
21
27
CMD [ "/sbin/init" ]
Original file line number Diff line number Diff line change @@ -8,5 +8,10 @@ RUN opkg update && \
8
8
iperf3 \
9
9
ip-full
10
10
RUN opkg list-upgradable | awk '{print $1}' | xargs opkg upgrade || true
11
+ ARG ts
12
+ ARG version
13
+ LABEL org.opencontainers.image.created=$ts
14
+ LABEL org.opencontainers.image.version=$version
15
+ LABEL org.opencontainers.image.source=https://github.com/oofnikj/docker-openwrt
11
16
12
17
CMD [ "/sbin/init" ]
Original file line number Diff line number Diff line change 8
8
docker build \
9
9
--build-arg ROOT_PW \
10
10
--build-arg OPENWRT_SOURCE_VER \
11
+ --build-arg ts=" $( shell date) " \
12
+ --build-arg version=" ${OPENWRT_SOURCE_VER} " \
11
13
-t ${BUILD_TAG} .
12
14
rm openwrt-${OPENWRT_SOURCE_VER} -x86-64-generic-rootfs.tar.gz
13
15
Original file line number Diff line number Diff line change 11
11
set -e
12
12
13
13
IMG=${1:- ' image.img' }
14
+ . ./openwrt.conf
14
15
15
16
check_uid () {
16
17
if [[ $( id -u) -ne 0 ]]; then
@@ -31,6 +32,8 @@ docker_build() {
31
32
echo " * building Docker image"
32
33
docker build \
33
34
--build-arg ROOT_PW=" ${ROOT_PW} " \
35
+ --build-arg ts=" $( date) " \
36
+ --build-arg version=" ${VERSION:- $OPENWRT_SOURCE_VER } " \
34
37
-t ${BUILD_TAG} -f Dockerfile.rpi ${tmpdir}
35
38
}
36
39
You can’t perform that action at this time.
0 commit comments