Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix go error (new dockerfile included) #76

Open
WiredLife opened this issue Nov 6, 2024 · 0 comments
Open

fix go error (new dockerfile included) #76

WiredLife opened this issue Nov 6, 2024 · 0 comments

Comments

@WiredLife
Copy link

WiredLife commented Nov 6, 2024

if you run in to this error

"=> ERROR [builder 5/5] RUN cd /root/go/src/dyndns && go get && go test -v 1.4s

[builder 5/5] RUN cd /root/go/src/dyndns && go get && go test -v:
1.340 # github.com/gorilla/mux
1.340 ../github.com/gorilla/mux/route.go:28:15: undefined: any
------"

use this dockerfile

FROM golang:1.19 AS builder
RUN DEBIAN_FRONTEND=noninteractive apt-get update &&
apt-get install -q -y git-core &&
apt-get clean
ENV GOPATH=/root/go
RUN mkdir -p /root/go/src
COPY rest-api /root/go/src/dyndns
RUN cd /root/go/src/dyndns && go mod init dyndns && go mod tidy && go build -o dyndns .
FROM debian:buster-slim
MAINTAINER David Prandzioch [email protected]
RUN DEBIAN_FRONTEND=noninteractive apt-get update &&
apt-get install -q -y bind9 dnsutils &&
apt-get clean
RUN chmod 770 /var/cache/bind
COPY setup.sh /root/setup.sh
RUN chmod +x /root/setup.sh
COPY named.conf.options /etc/bind/named.conf.options
COPY --from=builder /root/go/src/dyndns/dyndns /root/dyndns
EXPOSE 53 8080
CMD ["sh", "-c", "/root/setup.sh ; service bind9 start ; /root/dyndns"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant