Skip to content

Commit ef9a589

Browse files
committed
Initial version
1 parent ef337b3 commit ef9a589

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM multiarch/crossbuild
2+
3+
RUN hg clone https://bitbucket.org/hirofuchi/xnbd
4+
5+
WORKDIR /workdir/xnbd/trunk
6+
7+
RUN mkdir -p /artifacts
8+
9+
ENV CROSS_TRIPLE=armv7l
10+
RUN apt-get install -q -y libglib2.0-dev:armhf
11+
RUN crossbuild cc -c -std=c99 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/glib-2.0 -static xnbd_client.c xnbd_common.c lib/*.c \
12+
&& crossbuild cc -static *.o -pthread /usr/lib/arm-linux-gnueabihf/libglib-2.0.a -o /artifacts/armv7l-xnbd-client-static \
13+
&& cp /artifacts/armv7l-xnbd-client-static /artifacts/armv7l-xnbd-client-static-stripped \
14+
&& crossbuild strip /artifacts/armv7l-xnbd-client-static-stripped
15+
16+
ENV CROSS_TRIPLE=x86_64
17+
RUN apt-get install -q -y libglib2.0-dev
18+
RUN crossbuild cc -c -std=c99 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/glib-2.0 -static xnbd_client.c xnbd_common.c lib/*.c \
19+
&& crossbuild cc -static *.o -pthread /usr/lib/x86_64-linux-gnu/libglib-2.0.a -o /artifacts/x86_64-xnbd-client-static \
20+
&& cp /artifacts/x86_64-xnbd-client-static /artifacts/x86_64-xnbd-client-static-stripped \
21+
&& crossbuild strip /artifacts/x86_64-xnbd-client-static-stripped
22+
23+
RUN ls -la /artifacts \
24+
&& file /artifacts/*

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build:
2+
docker build -t build-xnbd-client-static .

0 commit comments

Comments
 (0)