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

Update Dockerfile to not depend on custom base image #17802

Merged
merged 5 commits into from
Jun 17, 2020

Conversation

sampaiodiego
Copy link
Member

@sampaiodiego sampaiodiego commented Jun 2, 2020

Proposed changes

Depending on "base image" adds an additional step every time we need to update a dependency on our Docker image so I'm changing the base image to a node-slim.

I have also updated to Debian Buster (previously using Stretch), the current stable version.

Some changes described below might be considered breaking, so please let me know if I need to change anything.

Issue(s)

RocketChat/Docker.Official.Image#112 (comment)

How to test or reproduce

Screenshots

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Hotfix (a major bugfix that has to be merged asap)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Changelog

Further comments

Some important changes included in this change:

  • removed curl - just like on our official image, it's still used during node installation process but was removed from the final image
  • removed rocket.chat certificate and gpg (gnupg dirmr) - apparently not being used
  • removed imagemagick dependency - it was used before to resize uploaded images, but we're currently using sharp that doesn't depend on imagemagick

@Sing-Li
Copy link
Member

Sing-Li commented Jun 2, 2020

Awesome. Also improves transparency of implementation for open source community. (Even though source to base is available, it requires effort to locate and is mostly mysterious.)

@geekgonecrazy
Copy link
Contributor

I don’t see any of the removed items as a breaking change so long as functionality of rc doesn’t some how depend on them.

The only downside I guess really is the one liner to prep stuff is kinda long. Wonder if putting in a single script that is added early on and cached would be acceptable?

.docker/Dockerfile Outdated Show resolved Hide resolved
@geekgonecrazy
Copy link
Contributor

Can we put all prep of the image in one layer, and then add /app and finally the npm install and cleanup?

That way we maximize cache?

@sampaiodiego
Copy link
Member Author

Can we put all prep of the image in one layer, and then add /app and finally the npm install and cleanup?

That way we maximize cache?

you mean move other things to same layer as the nodejs installation?

I've done this way to keep it easy to update, so one layer for node and another one for rocket.chat stuff (user creation and dependencies).

although maximising cache is good, we don't have docker cache on github actions 😞

@geekgonecrazy
Copy link
Contributor

This is technically valid and we could probably merge.

Just doesn’t feel like a great dockerfile. But I might be spoiled to dockerizing go binaries ;)

A thought/question?

Do we want to keep maintaining nodejs inside?

If I remember right originally we started off with the rocketchat/base image not because of nodejs. But actually because we wanted to pack our gpg keys and nodejs both in so when we fetched from the release service we could verify.

but since we are bringing the bundle in from the ci. That original purpose is gone.

On the official image we deviated from a nodejs because it vanished on us. Do we have that worry here or could we depend on it? For the mongo all in one I think we have no choice. But for our main image?

@sampaiodiego
Copy link
Member Author

sampaiodiego commented Jun 17, 2020

On the official image we deviated from a nodejs because it vanished on us. Do we have that worry here or could we depend on it? For the mongo all in one I think we have no choice. But for our main image?

right, I guess we can be based on official node here as we don't have same issues we have on our official image, the idea was to have similar Dockerfiles for both versions, but I agree we don't need all this noise here..

I'll make the changes and update the PR description.. =)

@geekgonecrazy
Copy link
Contributor

There we go! That doesn’t feel so massive

@sampaiodiego sampaiodiego changed the title Update Dockerfile to not depend on base image Update Dockerfile to not depend on custom base image Jun 17, 2020
@sampaiodiego sampaiodiego merged commit e18c3c0 into develop Jun 17, 2020
@sampaiodiego sampaiodiego deleted the update-dockerfile branch June 17, 2020 14:23
ggazzo added a commit that referenced this pull request Jun 18, 2020
…apps_rewrite* 'develop' of github.com:RocketChat/Rocket.Chat: (28 commits) [IMPROVE] Performance editing Admin settings (#17916)  [IMPROVE] React hooks lint rules (#17941)  [FIX] StreamCast stream to server only streamers (#17942)  [FIX] Profile save button not activates properly when changing the username field (#16541)  [FIX] Outgoing webhook: Excessive spacing between trigger words (#17830)  [FIX] Links being escaped twice leading to visible encoded characters (#16481)  [NEW][API] New endpoints to manage User Custom Status `custom-user-status.create`, custom-user-status.delete` and `custom-user-status.update` (#16550)  [FIX] Message action popup doesn't adjust itself on screen resize (#16508)  [FIX] Not possible to translate the label of custom fields in user's Info (#15595)  [FIX] Close the user info context panel does not navigate back to the user's list (#14085)  [FIX] Missing pinned icon indicator for messages pinned (#16448)  Chatpal: limit results to current room (#17718)  Do not build Docker image for fork PRs (#17370)  [IMPROVE] Use REST for DDP calls by default (#17934)  [IMPROVE] Add rate limiter to UiKit endpoints (#17859)  LingoHub based on develop (#17796)  [IMPROVE] Change default upload settings to only block SVG files (#17933)  Update Dockerfile to not depend on custom base image (#17802)  [IMPROVE][Performance] Add new database indexes to improve data query performance (#17839)  [FIX] Undesirable message updates after user saving profile (#17930)  ...
@sampaiodiego sampaiodiego mentioned this pull request Jun 30, 2020
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.

3 participants