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
.devcontainer/devcontainer.json
Normal file
22
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,22 @@
|
||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
|
||||
{
|
||||
"name": "Debian",
|
||||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||
"image": "mcr.microsoft.com/devcontainers/base:bullseye",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
|
||||
}
|
||||
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
// "features": {},
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
|
||||
// Configure tool-specific properties.
|
||||
// "customizations": {},
|
||||
|
||||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||
// "remoteUser": "root"
|
||||
}
|
||||
18
Dockerfile
18
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 \
|
||||
&& mkdir 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