Files
go-rpi-ws2811-lib/Dockerfile
nathan e0fd605d29
Some checks are pending
go-rpi-ws2811-lib/pipeline/head Build queued...
Update 'Dockerfile'
2023-06-04 22:01:19 +00:00

26 lines
746 B
Docker

FROM golang:alpine AS lib_builder
WORKDIR /foundry
RUN apk add git make linux-headers cmake g++
RUN git clone https://github.com/jgarff/rpi_ws281x.git \
&& cd rpi_ws281x \
&& mkdir build \
&& cd build \
&& cmake -D BUILD_SHARED=OFF -D BUILD_TEST=OFF .. \
&& cmake --build . \
&& make 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++
WORKDIR /go/src/github.com/rpi-ws281x/rpi-ws281x-go
COPY . .
RUN GO111MODULE=off go get -d -v ./...
RUN GO111MODULE=off go build -v ./...
WORKDIR /go