From 3f8015f639f3d533c47011f1cceeef1952d657a8 Mon Sep 17 00:00:00 2001 From: Nobuhiro MIKI Date: Tue, 13 Aug 2024 13:29:30 +0000 Subject: [PATCH 1/2] Bump Go version to 1.22.6 to build sshd binary. Signed-off-by: Nobuhiro MIKI --- .gitignore | 1 + busybox/Makefile | 5 ++--- busybox/go.mod | 10 ++++++++++ busybox/go.sum | 8 ++++++++ centos6.Dockerfile | 6 +++--- 5 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 busybox/go.mod create mode 100644 busybox/go.sum diff --git a/.gitignore b/.gitignore index 723fc61..a3e77d2 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ *.o *.ko *.order +!go.mod Module.symvers busybox-* linux-* diff --git a/busybox/Makefile b/busybox/Makefile index bbdc522..3563302 100644 --- a/busybox/Makefile +++ b/busybox/Makefile @@ -23,9 +23,8 @@ root.img: .config busybox.tar.bz2 inittab passwd rcS sshd sshd:/bin/sshd \ sshd: sshd.go - sudo docker run --rm -v $(CWD):/tmp buildenv-busybox \ - /bin/bash -c "cd /tmp; \ - go get github.com/kr/pty golang.org/x/crypto/ssh; \ + sudo docker run --rm -v $(CWD):/tmp/build buildenv-busybox \ + /bin/bash -c "cd /tmp/build; \ go build -a -ldflags '-extldflags \"-static\"' sshd.go" busybox.tar.bz2: diff --git a/busybox/go.mod b/busybox/go.mod new file mode 100644 index 0000000..192daf8 --- /dev/null +++ b/busybox/go.mod @@ -0,0 +1,10 @@ +module bobuhiro11.net/busybox + +go 1.22.6 + +require ( + github.com/creack/pty v1.1.7 // indirect + github.com/kr/pty v1.1.8 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/sys v0.23.0 // indirect +) diff --git a/busybox/go.sum b/busybox/go.sum new file mode 100644 index 0000000..be5f321 --- /dev/null +++ b/busybox/go.sum @@ -0,0 +1,8 @@ +github.com/creack/pty v1.1.7 h1:6pwm8kMQKCmgUg0ZHTm5+/YvRK0s3THD/28+T6/kk4A= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/kr/pty v1.1.8 h1:AkaSdXYQOWeaO3neb8EM634ahkXXe3jYbVh/F9lq+GI= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= +golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= diff --git a/centos6.Dockerfile b/centos6.Dockerfile index 5fe6ddc..640a345 100644 --- a/centos6.Dockerfile +++ b/centos6.Dockerfile @@ -15,6 +15,6 @@ RUN sed -i "s|#baseurl=|baseurl=|g" /etc/yum.repos.d/CentOS-Base.repo \ RUN yum install -y gcc perl glibc-static kernel kernel-devel \ autoconf zlib-devel zlib-static openssl-static openssl-devel curl -RUN curl -OL https://go.dev/dl/go1.17.6.linux-amd64.tar.gz \ - && tar -C $GO_INST_DIR -xzf go1.17.6.linux-amd64.tar.gz \ - && rm go1.17.6.linux-amd64.tar.gz +RUN curl -OL https://go.dev/dl/go1.22.6.linux-amd64.tar.gz \ + && tar -C $GO_INST_DIR -xzf go1.22.6.linux-amd64.tar.gz \ + && rm go1.22.6.linux-amd64.tar.gz From 1e12948b51859d4bd3bcea900b61672a26c3e8b3 Mon Sep 17 00:00:00 2001 From: Nobuhiro MIKI Date: Tue, 13 Aug 2024 13:44:52 +0000 Subject: [PATCH 2/2] Fix mirror for CentOS 7. Signed-off-by: Nobuhiro MIKI --- centos7.Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/centos7.Dockerfile b/centos7.Dockerfile index 4ebccae..114decb 100644 --- a/centos7.Dockerfile +++ b/centos7.Dockerfile @@ -1,4 +1,8 @@ FROM ghcr.io/pandemonium1986/centos7:latest +RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \ + sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* && \ + yum -y update && yum clean all + RUN yum install -y gcc perl glibc-static make flex bison kernel-devel \ kernel elfutils-libelf-devel openssl