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

Use Dockerfile to build Pakkero #4

Merged
merged 5 commits into from
Mar 16, 2021
Merged

Conversation

alfonmga
Copy link
Contributor

A Dockerfile would propose a solution to issues like #2 and #3.

Screenshot 2021-03-16 at 17 15 09

@89luca89
Copy link
Owner

89luca89 commented Mar 16, 2021

Thanks for the pull @alfonmga !

Testing locally works well with both docker and podman

Could we add the upx dependency to enable compression?

EDIT: also you can add both docker and podman instructions in README as it works fine :)

@alfonmga
Copy link
Contributor Author

Podman (version 3.0.1) worked for me too on an Ubuntu 20.04.2 LTS local box.

I didn't know about Podman so thanks a lot for mentioning it :)

@89luca89
Copy link
Owner

89luca89 commented Mar 16, 2021

Super thanks a lot @alfonmga

Can I suggest to use alpine for the docker image?

With this dockerfile:

FROM golang:alpine

ENV CGO_ENABLED=0
ENV GO111MODULE=off

RUN apk add --update-cache upx git make binutils coreutils \
    && rm -rf /var/cache/apk/*

RUN upx --version

RUN go version
RUN go get -d -v github.com/89luca89/pakkero

WORKDIR $GOPATH/src/github.com/89luca89/pakkero
RUN make

RUN ./dist/pakkero -v

ENTRYPOINT ["./dist/pakkero"]

It generates a working image that clocks at ~370mb vs 914mb of standard debian based one :)

EDIT: yea Podman is great and comes standard in Fedora based distro :) so confirmed also working on podman fedora and ubuntu great 👍

@alfonmga
Copy link
Contributor Author

alfonmga commented Mar 16, 2021

Super thanks a lot @alfonmga

Can I suggest to use alpine for the docker image?

With this dockerfile:

FROM golang:alpine

ENV CGO_ENABLED=0
ENV GO111MODULE=off

RUN apk add --update-cache upx git make binutils coreutils \
    && rm -rf /var/cache/apk/*

RUN upx --version

RUN go version
RUN go get -d -v github.com/89luca89/pakkero

WORKDIR $GOPATH/src/github.com/89luca89/pakkero
RUN make

RUN ./dist/pakkero -v

ENTRYPOINT ["./dist/pakkero"]

It generates a working image that clocks at ~370mb vs 914mb of standard debian based one :)

EDIT: yea Podman is great and comes standard in Fedora based distro :) so confirmed also working on podman fedora and ubuntu great 👍

I prefer to use Alpine Linux distribution too. But recently I never go for it because I remember an article that I read some time ago, so I always go for a non-Alpine image because of that :)

Anyways, in this case everything works as expected, the built image size is smaller and build time is faster, as we would expect from an Alpine image. I committed the change.

@89luca89
Copy link
Owner

Great thnks @alfonmga merging 👍

About the image size, yes the problem it's mainly on python images

@89luca89 89luca89 merged commit 7d3bbc3 into 89luca89:master Mar 16, 2021
@alfonmga alfonmga deleted the dockerfile branch March 16, 2021 18:43
@alfonmga alfonmga restored the dockerfile branch March 17, 2021 23:23
@alfonmga alfonmga deleted the dockerfile branch March 17, 2021 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants