Skip to content

Commit

Permalink
Fix dhcping in eclient image and update deps
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
  • Loading branch information
giggsoff committed Jun 28, 2022
1 parent 2d150cf commit dff5c48
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 10 deletions.
46 changes: 37 additions & 9 deletions tests/eclient/image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,44 @@
FROM golang:1.16-alpine AS build

# hadolint ignore=DL3018
RUN apk add --no-cache \
musl-dev \
automake \
make \
gcc \
patch

COPY patches /patches

WORKDIR /go/src/local_manager
COPY pkg .

RUN go build -ldflags "-s -w" -o /out/local_manager main.go
RUN CGO_ENABLED=0 go build -ldflags "-s -w" -o /out/root/local_manager main.go

FROM alpine:3.14.2
ARG DHCPING_VERSION=1.2
WORKDIR /
RUN wget -q "https://www.mavetju.org/download/dhcping-${DHCPING_VERSION}.tar.gz" && \
tar -xvf dhcping-${DHCPING_VERSION}.tar.gz
WORKDIR /dhcping-${DHCPING_VERSION}
RUN set -e && for patch in "/patches/dhcping-${DHCPING_VERSION}"/*.patch; do \
echo "Applying $patch"; \
patch -p1 < "$patch"; \
done
RUN case $(uname -m) in \
x86_64) \
./configure --prefix=/usr; \
;; \
aarch64) \
./configure --build=arm64-unknown-linux-gnu --prefix=/usr; \
;; \
esac && \
make && make DESTDIR=/out install

COPY files /out/
COPY cert/id_rsa* /out/root/.ssh/
COPY cert/id_rsa.pub /out/root/.ssh/authorized_keys

FROM alpine:3.14.6

# hadolint ignore=DL3018
RUN apk add --no-cache lshw \
Expand All @@ -19,14 +52,9 @@ RUN apk add --no-cache lshw \
jq \
setserial \
avahi \
lsblk \
dhcping

COPY cert/id_rsa* /root/.ssh/
COPY cert/id_rsa.pub /root/.ssh/authorized_keys
lsblk

COPY files /
COPY --from=build /out/local_manager /root/
COPY --from=build /out /

SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN mkdir -p /mnt && \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 27e74baf97c4669e14b8c690044ab979dc34b2ef Mon Sep 17 00:00:00 2001
From: Petr Fedchenkov <giggsoff@gmail.com>
Date: Tue, 28 Jun 2022 10:54:24 +0300
Subject: [PATCH] Fix type to not hit endless getopt loop

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
---
dhcping.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dhcping.c b/dhcping.c
index 7eb5ae6..cdce51c 100644
--- a/dhcping.c
+++ b/dhcping.c
@@ -70,7 +70,7 @@ unsigned char serveridentifier[4];
int maxwait=3;

void doargs(int argc,char **argv) {
- char ch;
+ int ch;

inform=request=verbose=VERBOSE=quiet=0;
ci=gi=server="0.0.0.0";
--
2.34.1

2 changes: 1 addition & 1 deletion tests/io_performance/image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.15 as builder
FROM golang:1.16-alpine as builder

WORKDIR /app
COPY mkconfig /app/mkconfig
Expand Down

0 comments on commit dff5c48

Please sign in to comment.