You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm trying to dockerize my project and I need to install the gocron package, but when it's building the container returns me the next error:
no required module provides package github.com/jasonlvhit/gocron; to add it:
#0 1.228 go get github.com/jasonlvhit/gocron
FROM golang:1.20.2
# set working directory
WORKDIR /usr/src/app
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
COPY go.mod go.sum ./
RUN go mod download && go mod verify
RUN go get github.com/jasonlvhit/gocron
# install gin for hot reloading
RUN go install github.com/codegangsta/gin@latest
# copy the source code
COPY . .
# build the binary
RUN go build -v -o /usr/local/bin/app ./...
# expose port 80
EXPOSE 80
# command to start the application with hot reloading
CMD gin -i -p 80 -a 8080 run app
When I installed on local enviroment works correctly, but I need to runs on docker :S
The text was updated successfully, but these errors were encountered:
It looks like the dependency must not be in your go.mod as you're running go get inside the docker file. Instead, you'll want to add the dep to your go.mod outside of docker and run go mod tidy
Hi, I'm trying to dockerize my project and I need to install the gocron package, but when it's building the container returns me the next error:
I imported in my go file like this:
And this is my Dockerfile config
When I installed on local enviroment works correctly, but I need to runs on docker :S
The text was updated successfully, but these errors were encountered: