sameerdhoot / wolweb

Web interface for sending Wake-on-lan (magic packet). An HTTP server built using GoLang and uses Bootstrap for UI.
GNU General Public License v3.0
288 stars 74 forks source link

Debian_Dockerfile missing go mod init wolweb line #22

Closed misosoup7 closed 1 year ago

misosoup7 commented 1 year ago

Debian Dockerfile fails because go mod init wolweb is missing compared to the Alpine Dockerfile. Should be the following (I also updated it to Bullseye over buster since I was running Bullseye Debian.

FROM golang:bullseye AS builder

LABEL org.label-schema.vcs-url="https://github.com/sameerdhoot/wolweb" \
      org.label-schema.url="https://github.com/sameerdhoot/wolweb/blob/master/README.md"

RUN mkdir /wolweb
WORKDIR /wolweb

# Install Dependecies
RUN git clone https://github.com/sameerdhoot/wolweb . && \
    go mod init wolweb && \
    go get -d github.com/gorilla/handlers && \
    go get -d github.com/gorilla/mux && \
    go get -d github.com/ilyakaznacheev/cleanenv

# Build Source Files
RUN go build -o wolweb .

# Create 2nd Stage final image
FROM debian
WORKDIR /wolweb
COPY --from=builder /wolweb/index.html .
COPY --from=builder /wolweb/wolweb .
COPY --from=builder /wolweb/devices.json .
COPY --from=builder /wolweb/config.json .
COPY --from=builder /wolweb/static ./static

ARG WOLWEBPORT=8089

CMD ["/wolweb/wolweb"]

EXPOSE ${WOLWEBPORT}
sameerdhoot commented 1 year ago

The repo now has a new Dockerfile which uses Go version 1.20. This was suggested by another PR which I have now merged. I am working on another PR which updates the Debain_Dockerfile and I will soon merge the PR. I am waiting for the PR author to make some changes before the merge.

sameerdhoot commented 1 year ago

Look at PR #19

sameerdhoot commented 1 year ago

I have checked in a new Debian_Dockerfile which now uses Go 1.20