Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Clean Yarn cache from Docker image #14

Closed
deboer-tim opened this issue Dec 22, 2017 · 5 comments
Closed

Clean Yarn cache from Docker image #14

deboer-tim opened this issue Dec 22, 2017 · 5 comments
Assignees

Comments

@deboer-tim
Copy link

The Theia docker image is pretty big. When I dug into it, there's 335Mb in the Yarn cache that is pulled in during build and then never used again. I've found some other projects that have added "&& yarn clear cache" to their docker builds, which would clean this up and reduce the image size by 335Mb.

Also noticed the --production=true flag while I was investigating this, not sure if that would speed up the build or remove unnecessary dependencies too.

@hexa00
Copy link

hexa00 commented Dec 22, 2017

Sounds like a good idea to do this... --production will not install devDependencies which should be OK.

@akosyakov
Copy link
Member

It should work if we install @theia/cli as a global node module instead of a dev dependency.

It could be worth to investigate yarn autoclean for this matter as well.

@akosyakov akosyakov self-assigned this Jan 5, 2018
@akosyakov
Copy link
Member

RFC to avoid using yarn cache: yarnpkg/rfcs#53 - discussed how to work it around for different cases

@akosyakov
Copy link
Member

I've tried to remove @theia/cli from dev dependencies, but it is not so straightforward:

  • theia build does not work from global modules, webpack cannot be resolved for some reasons
  • and we use theia start to start the app

To use --production flag these issues should be resolved first.

akosyakov added a commit that referenced this issue Jan 5, 2018
Signed-off-by: Anton Kosiakov <anton.kosyakov@typefox.io>
akosyakov added a commit that referenced this issue Jan 5, 2018
Signed-off-by: Anton Kosiakov <anton.kosyakov@typefox.io>
JanKoehnlein added a commit that referenced this issue Jan 5, 2018
GH-14 remove yarn cache within same docker RUN step...
@akosyakov
Copy link
Member

We've managed to reduce the size of theiaide/theia significantly by:

Docker file is here: https://github.com/theia-ide/theia-apps/blob/master/theia-docker/Dockerfile

This was referenced Jan 5, 2018
marcdumais-work pushed a commit that referenced this issue Aug 3, 2018
Signed-off-by: Anton Kosiakov <anton.kosyakov@typefox.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants