Skip to content

Commit 54e4797

Browse files
authoredFeb 12, 2020
feat: create a docker environment for flux release (#2514)
This patch adds the start of a Dockerfile to be used for releasing flux, complete with cross compilers for all triples except `x86_64-apple-darwin` and `x86_64-pc-windows-gnu`, which require a bit more setup. The intent here is to start with the Dockerfile, add support for using `pkg-config` (and ditching `flux-config`), and being able to build flux, including `libflux`, for any architecture by invoking `go build`. This docker image will be used similar to `Dockerfile_build` is converted into `quay.io/influxdb/flux-build`.
1 parent 92f8754 commit 54e4797

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed
 

‎.dockerignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
*
1+
.git
2+
libflux/target/

‎Dockerfile_release

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM golang:1.13
2+
3+
ENV PATH="/root/.cargo/bin:${PATH}"
4+
ENV GO111MODULE=on
5+
ENV CGO_ENABLED=1
6+
7+
COPY . /go/src/github.com/influxdata/flux
8+
WORKDIR /go/src/github.com/influxdata/flux
9+
10+
# Install common packages
11+
RUN apt-get update && \
12+
apt-get install --no-install-recommends -y \
13+
clang \
14+
gcc-arm-linux-gnueabihf \
15+
gcc-arm-linux-gnueabi \
16+
gcc-aarch64-linux-gnu \
17+
gcc-i686-linux-gnu && \
18+
rm -rf /var/lib/apt/lists/*
19+
RUN curl https://sh.rustup.rs -sSf | \
20+
sh -s -- --default-toolchain stable -y
21+
22+
RUN cd libflux && cargo build
23+
RUN go build \
24+
-ldflags '-extldflags "-fno-PIC -static"' \
25+
-buildmode pie \
26+
-tags 'libflux static_build' \
27+
-o flux \
28+
.

0 commit comments

Comments
 (0)
Please sign in to comment.