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

Reduce the size of Docker image #26

Open
utkarsh-1905 opened this issue Aug 1, 2023 · 1 comment
Open

Reduce the size of Docker image #26

utkarsh-1905 opened this issue Aug 1, 2023 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@utkarsh-1905
Copy link
Owner

In the previous release, the docker image was built on top of the scratch image and worked fine.
But after committing 599ee68, the image built using the previous docker file shows an invalid pointer dereference error, but it is working fine on the full-size go-alpine image.

Image size increased from 15MB -> 450MB

@utkarsh-1905 utkarsh-1905 added bug Something isn't working help wanted Extra attention is needed labels Aug 1, 2023
@ItsMeSamey
Copy link

this seems to run fine for me: checked out the previous commit too, same thing

FROM golang:1.20.4-alpine AS build
WORKDIR /app

COPY ./ ./
RUN go mod download

RUN go build main.go

LABEL traefik.port=80
LABEL traefik.http.routers.tt.rule="Host(`timetable.mlsctiet.com`)"
LABEL traefik.http.routers.tt.tls=true
LABEL traefik.http.routers.tt.tls.certresolver="lets-encrypt"
LABEL org.opencontainers.image.source="https://github.com/utkarsh-1905/time-table"


FROM scratch
WORKDIR /app

COPY --from=build /app/main ./
COPY --from=build /app/data.json ./
COPY --from=build /app/timetable.xlsx ./

# if deployed on personal server
EXPOSE 3000
CMD ["./main"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants