Files
go-rpi-ws2811-lib/Dockerfile
nathan e59deb0427
Some checks failed
build lightwatch / build (push) Failing after 3h13m58s
Update 'Dockerfile'
2025-11-02 22:23:02 +00:00

27 lines
747 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