Skip to content

Commit

Permalink
build(container): use golang container instead of fedora container
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuar committed Dec 30, 2023
1 parent 90d3a49 commit 1feb4aa
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
FROM fedora:latest
FROM golang:1.21

WORKDIR /usr/src/go-hass-agent

RUN sudo dnf -y --setopt=tsflags=nodocs install golang gcc \
libXcursor-devel libXrandr-devel mesa-libGL-devel \
libXi-devel libXinerama-devel libXxf86vm-devel && \
dnf clean all
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt -y install golang gcc libgl1-mesa-dev xorg-dev && rm -rf /var/lib/apt/lists/*

# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
COPY go.mod go.sum ./
Expand All @@ -20,6 +18,6 @@ RUN go install github.com/matryer/moq@latest
RUN go install golang.org/x/tools/cmd/stringer@latest
RUN go install golang.org/x/text/cmd/gotext@latest
RUN go generate ./...
RUN go build -v -o /usr/bin/go-hass-agent
RUN go build -v -o /go/bin/go-hass-agent

CMD ["go-hass-agent", "--terminal"]

0 comments on commit 1feb4aa

Please sign in to comment.