diff --git a/docker/Dockerfile.build b/docker/Dockerfile.build index 93f3f31..b92b471 100644 --- a/docker/Dockerfile.build +++ b/docker/Dockerfile.build @@ -10,13 +10,10 @@ ENV GO111MODULE=on \ WORKDIR /app # Copy the package files -COPY go.mod ./ +COPY . . # Install all go_modules -RUN go mod download - -# Copy the package files -COPY . . +RUN go mod tidy # Build the project RUN go build -o /go/bin/run . diff --git a/docker/Dockerfile.test b/docker/Dockerfile.test index 222b7ad..c361370 100644 --- a/docker/Dockerfile.test +++ b/docker/Dockerfile.test @@ -9,14 +9,11 @@ ENV GO111MODULE=on \ # Set a working directory WORKDIR /app -# Copy the package files -COPY go.mod ./ - -# Install all go_modules -RUN go mod download - # Copy the entire project COPY . . +# Install all go_modules +RUN go mod tidy + # Specify the command from running tests CMD go test -v ./test/... \ No newline at end of file