From 62105474712e6e0db824ae1610bfd41b7a83ac39 Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Sun, 29 Sep 2024 08:50:55 +0000 Subject: [PATCH] builder. --- Dockerfile | 16 +++++++++++----- go.mod | 2 +- vendor/modules.txt | 8 ++++---- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 55684a62..e8027038 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,12 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 AS builder LABEL maintainer="Charlie Lewis " +RUN apt-get update && apt-get install -y --no-install-recommends \ + golang ca-certificates +COPY . /go/src/dovesnap +WORKDIR /go/src/dovesnap +RUN go build -o /dovesnap . + +FROM ubuntu:24.04 RUN apt-get update && apt-get install -y --no-install-recommends \ iptables dbus && \ apt-get clean && \ @@ -7,11 +14,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ RUN update-alternatives --set iptables /usr/sbin/iptables-legacy RUN apt-get update && apt-get install -y --no-install-recommends \ ethtool iproute2 openvswitch-common openvswitch-switch \ - udhcpc ca-certificates golang && \ + udhcpc golang && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* -COPY . /go/src/dovesnap -WORKDIR /go/src/dovesnap -RUN go build -o / . +WORKDIR / +COPY --from=builder /dovesnap/ . COPY udhcpclog.sh /udhcpclog.sh ENTRYPOINT ["/dovesnap"] diff --git a/go.mod b/go.mod index 4b3c0376..bb751bb4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module dovesnap -go 1.18 +go 1.22 require ( github.com/docker/docker v27.3.1+incompatible diff --git a/vendor/modules.txt b/vendor/modules.txt index 9a6d9049..ae514616 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -65,10 +65,10 @@ github.com/go-logr/stdr ## explicit github.com/godbus/dbus # github.com/gogo/protobuf v1.3.2 -## explicit; go 1.15 +## explicit; go 1.18 github.com/gogo/protobuf/proto # github.com/iqtlabs/faucetconfrpc v0.55.72 -## explicit +## explicit; go 1.18 github.com/iqtlabs/faucetconfrpc/faucetconfserver # github.com/kenshaw/baseconv v0.1.1 ## explicit; go 1.15 @@ -133,7 +133,7 @@ go.opentelemetry.io/otel/metric/noop go.opentelemetry.io/otel/trace go.opentelemetry.io/otel/trace/embedded # golang.org/x/mod v0.21.0 -## explicit; go 1.22 +## explicit; go 1.22.0 # golang.org/x/net v0.29.0 ## explicit; go 1.18 golang.org/x/net/http/httpguts @@ -157,7 +157,7 @@ golang.org/x/text/unicode/norm # golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac ## explicit # golang.org/x/tools v0.25.0 -## explicit; go 1.22 +## explicit; go 1.22.0 # google.golang.org/genproto/googleapis/rpc v0.0.0-20240924160255-9d4c2d233b61 ## explicit; go 1.21 google.golang.org/genproto/googleapis/rpc/status