File tree Expand file tree Collapse file tree 3 files changed +41
-5
lines changed Expand file tree Collapse file tree 3 files changed +41
-5
lines changed Original file line number Diff line number Diff line change
1
+ # Ignore all
2
+ *
3
+ . *
4
+
5
+ # Except what we need to build
6
+ ! /configure
7
+ ! /configure.ac
8
+ ! /install-sh
9
+ ! /Makefile.in
10
+ ! /snmp_bulkget.c
11
+ ! /snmp_bulkget.h
12
+ ! /utils.c
13
+ ! /utils.h
Original file line number Diff line number Diff line change
1
+ FROM debian:stable-slim as builder
2
+ WORKDIR /src
3
+ ENV LANG="C.UTF-8"
4
+ ENV TERM=xterm
5
+ ARG target=""
6
+ ONBUILD ENV DEBIAN_FRONTEND=noninteractive
7
+ RUN apt-get update \
8
+ && apt-get install -y \
9
+ build-essential \
10
+ libsnmp-dev \
11
+ && rm -rf /var/lib/apt/lists/*
12
+ COPY . .
13
+ RUN ./configure --libexecdir=/src \
14
+ && make $target
15
+
16
+ FROM debian:stable-slim
17
+ ONBUILD ENV DEBIAN_FRONTEND=noninteractive
18
+ RUN apt-get update \
19
+ && apt-get install -y \
20
+ libsnmp30 \
21
+ && rm -rf /var/lib/apt/lists/*
22
+ COPY --from=0 /src/check_interfaces /check_interfaces
23
+
24
+ ENTRYPOINT ["/check_interfaces" ]
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ CFLAGS=@CFLAGS@ @DEFS@
14
14
# DLFLAGS=-fPIC -shared
15
15
BUILDLIBS =@SNMP_LIBS@ @LIBS@
16
16
17
- .PHONY : debug clean all install
17
+ .PHONY : debug clean distclean all install
18
18
all : build strip
19
19
build : $(TARGET )
20
20
@@ -28,12 +28,11 @@ debug: CFLAGS += -DDEBUG -g -O0
28
28
debug : LDFLAGS += -g -O0
29
29
debug : build
30
30
31
-
32
31
clean :
33
- rm $(OBJS ) $(TARGET )
32
+ rm -f $(OBJS ) $(TARGET )
34
33
34
+ distclean : clean
35
+ rm -f config.log config.status Makefile
35
36
36
37
install : all
37
38
$(INSTALL ) -t $(DESTDIR ) $(TARGET )
38
-
39
-
You can’t perform that action at this time.
0 commit comments