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 alpine baseimage, optimise build #8

Merged
merged 2 commits into from Feb 22, 2022
Merged

Use alpine baseimage, optimise build #8

merged 2 commits into from Feb 22, 2022

Conversation

thespad
Copy link
Contributor

@thespad thespad commented Feb 22, 2022

The node:16 baseimage you are using is over 900Mb, using the Alpine 3.15 image as a base and installing only the required node packages reduces the image size by 92%.

@revenz
Copy link
Owner

revenz commented Feb 22, 2022

just tried this, it does indeed reduce the size to about 30mb from nearly 350mb, nice.

however I currently get this error and the docker wont start

No log line matching the '' filter

@thespad
Copy link
Contributor Author

thespad commented Feb 22, 2022

Hmm, it's working when I build locally. Are you using Portainer? If there are no logs to display it'll just dump an error like that and from what I can see you don't get any log output until you actually visit the site, even with your existing image:

$ docker run -d --rm --name=fenrus --tmpfs /app/data --tmpfs /app/wwwroot/images -p 8123:3000 revenz/fenrus && docker logs -f fenrus
aab1651d2cc24b65d8a873f616d48e2ace7d040d88c6edba00ed35c823d28f1d

$ docker run -d --rm --name=fenrus --tmpfs /app/data --tmpfs /app/wwwroot/images -p 8123:3000 local/fenrus:latest && docker logs -f fenrus
73a65228b85caf4876efd2ce87b4fab9e7dd44a7ae88c8a0f52b370af046f2db

Loading the site then logs

############## req.url /
GET / 302 8.067 ms - 76
############## req.url /login?error=401
GET /login?error=401 200 9.133 ms - 4088

@revenz
Copy link
Owner

revenz commented Feb 22, 2022

yes that was from portainer. running manually with the windows docker client I get this error with it

Error invoking remote method 'docker-start-container': Error: (HTTP code 400) unexpected - OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "docker-entrypoint.sh": executable file not found in $PATH: unknown

The built image can be found here
https://hub.docker.com/layers/revenz/nodeportal/latest/images/sha256-0f678841881cac65407866cf54b11d350a64d9f1935c9089a387c235f78dc9c6?context=repo

@thespad
Copy link
Contributor Author

thespad commented Feb 22, 2022

Unfortunately I haven't got a Windows host to be able to test with and I can't replicate the issue on any of my Linux hosts. Can you try my built image docker.io/thespad/testbed:fenrus and see if it does the same thing.

@revenz revenz merged commit 54f9f92 into revenz:master Feb 22, 2022
@revenz
Copy link
Owner

revenz commented Feb 22, 2022

i'm going to merge this and then do a full build on TeamCity, if it doesn't work, ill just revert it.

@revenz
Copy link
Owner

revenz commented Feb 22, 2022

seems fine. think portainer was doing something odd when it was re-creating the image. deleting my old ones and fetching fresh ones worked.
thanks!

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