update to build appropriately
Some checks failed
build lightwatch / build (push) Failing after 3h9m25s
Some checks failed
build lightwatch / build (push) Failing after 3h9m25s
This commit is contained in:
22
Dockerfile
22
Dockerfile
@@ -2,25 +2,31 @@ FROM golang:alpine AS lib_builder
|
||||
|
||||
WORKDIR /foundry
|
||||
|
||||
RUN apk add git make linux-headers cmake g++
|
||||
# install build deps (use build-base to get gcc/g++)
|
||||
RUN apk add --no-cache git build-base linux-headers cmake
|
||||
RUN git clone https://github.com/jgarff/rpi_ws281x.git \
|
||||
&& cd rpi_ws281x \
|
||||
&& cd rpi_ws281x \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cd build \
|
||||
&& cmake -D BUILD_SHARED=OFF -D BUILD_TEST=OFF .. \
|
||||
&& cmake --build . \
|
||||
&& make install
|
||||
&& cmake --build . --target install
|
||||
|
||||
# Stage 1 : Build a go image with the rpi_ws281x C library and the go wrapper
|
||||
|
||||
|
||||
FROM golang:alpine
|
||||
COPY --from=lib_builder /usr/local/lib/libws2811.a /usr/local/lib/
|
||||
COPY --from=lib_builder /usr/local/include/ws2811 /usr/local/include/ws2811
|
||||
RUN apk add git make linux-headers cmake g++
|
||||
|
||||
# enable cgo and install build deps for the Go build
|
||||
ENV CGO_ENABLED=1
|
||||
RUN apk add --no-cache git build-base linux-headers cmake
|
||||
|
||||
WORKDIR /go/src/github.com/rpi-ws281x/rpi-ws281x-go
|
||||
COPY . .
|
||||
RUN GO111MODULE=off go get -d -v ./...
|
||||
RUN GO111MODULE=off go build -v ./...
|
||||
# Build in GOPATH mode (this repo has no go.mod).
|
||||
ENV GO111MODULE=off
|
||||
RUN go build -v ./...
|
||||
|
||||
WORKDIR /go
|
||||
|
||||
|
||||
Reference in New Issue
Block a user