-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docker): fix go-sqlite3 requires cgo to work error
- Loading branch information
Showing
4 changed files
with
10 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.git | ||
.github | ||
.vscode | ||
*.db | ||
**/*.gif | ||
**/*.png | ||
cache/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
FROM golang:1.21-alpine AS go-builder | ||
ENV CGO_ENABLED=1 | ||
RUN apk add --no-cache gcc musl-dev | ||
WORKDIR $GOPATH/src/github.com/ngshiheng/michelin-my-maps | ||
COPY go.mod go.sum ./ | ||
This comment has been minimized.
Sorry, something went wrong. |
||
RUN go mod download | ||
COPY . . | ||
RUN go build -o /bin/mym ./cmd/mym | ||
RUN go build -ldflags='-s -w -extldflags "-static"' -o /bin/mym ./cmd/mym | ||
|
||
FROM datasetteproject/datasette | ||
RUN datasette install datasette-publish-vercel | ||
|
||
COPY --from=go-builder /bin/mym /bin/mym | ||
|
||
ARG VERCEL_TOKEN | ||
ENV VERCEL_TOKEN=${VERCEL_TOKEN} | ||
RUN apt-get update -yq | ||
RUN apt-get -yq install curl gnupg ca-certificates | ||
RUN curl -L https://deb.nodesource.com/setup_18.x | bash | ||
RUN apt-get install -yq nodejs | ||
RUN npm i -g vercel | ||
|
||
RUN apt-get update -yq && apt-get -yq install curl gnupg ca-certificates && curl -L https://deb.nodesource.com/setup_18.x | bash && apt-get install -yq nodejs && npm i -g vercel | ||
COPY . . | ||
CMD ["./docker/docker-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Unrelated to the fix: this allows Docker to cache the downloaded dependencies. When you rebuild your Docker image, Docker can use the cached layers for the dependencies if the go.mod and go.sum files haven't changed