-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile.mips64
40 lines (34 loc) · 1.36 KB
/
Dockerfile.mips64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM ubuntu:22.04 as base
ENV DEBIAN_FRONTEND=noninteractive
# base applications
RUN apt-get update && apt-get install -y tzdata wget make git flex bison
# all our cross compile stuff
RUN apt-get install -y \
linux-libc-dev-mips64-cross \
gccgo-mips64-linux-gnuabi64 \
cpp-10-mips64-linux-gnuabi64 \
golang-1.18-go \
gccgo-10-mips64-linux-gnuabi64 \
libgo16-mips64-cross \
libgcc-10-dev-mips64-cross \
libc6-mips64-cross \
libc6-dev-mips64-cross
# don't actually use this... now
RUN mkdir -p /build/bin && cd /build/bin \
ln -s /usr/bin/gccgo-mips64-linux-gnuabi64 gccgo \
ln -s /usr/bin/mips64-linux-gnuabi64-ar ar \
ln -s /usr/bin/mips64-linux-gnuabi64-gcc gcc
# build libpcap
FROM base as libpcap
ENV LIBPCAP_VERSION=1.10.3
WORKDIR /build
RUN wget -qO - https://www.tcpdump.org/release/libpcap-${LIBPCAP_VERSION}.tar.gz | tar zxf - && \
cd libpcap-${LIBPCAP_VERSION} && \
CC=mips64-linux-gnuabi64-gcc BUILD_CC=gcc AR=mips64-linux-gnuabi64-gcc-ar RANLIB=mips64-linux-gnuabi64-ranlib \
./configure --build i686-pc-linux-gnu --host mips64-linux-gnuapbi64 --prefix=/usr/mips64-linux-gnuabi64 && make install
# build our app
FROM libpcap
WORKDIR /build/udp-proxy-2020
ENV GOROOT=/usr/lib/go-1.18
ENV PATH=/build/bin:${GOROOT}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENTRYPOINT make .linux-mips64