Answer the question
In order to leave comments, you need to log in
Golang application freezes when starting on Docker?
Everything is going well, but when you start the application just hangs without outputting anything to the console, what could be?
FROM golang:1.11.9-alpine
RUN apk update && apk upgrade && \
apk add --no-cache bash git
RUN mkdir -p /go/src/app
WORKDIR /go/src/app
COPY . /go/src/app
RUN mkdir -p /etc/futcamp/
RUN mkdir -p /var/log/futcamp/
COPY ./router.conf /etc/futcamp/
RUN go get
RUN go install
CMD ["app"]
EXPOSE 8080
Answer the question
In order to leave comments, you need to log in
Run the container from the second console docker exec -it <containername> sh
And start poking around in it. In particular, try in a similar way by calling app to try to start the application. Perhaps the executable flag is not set, or you need to run it like this: ./app
Notes on the dockerfile:
RUN go get && go install
This way you will reduce the number of layers in your imageDidn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question