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

Add Dockerfile (part 2) #9426

Merged
merged 7 commits into from
May 1, 2019
Merged

Add Dockerfile (part 2) #9426

merged 7 commits into from
May 1, 2019

Conversation

turt2live
Copy link
Member

Continuation of #7771
Fixes #315

I've opened a new PR for this instead of committing directly to the author's original branch because their branch is named "develop" and I don't want to accidentally break anything.

Changes from the original concept:

  • Reduce build context size for dirty environments (developers)
  • Support using custom SDKs - this is to support us having a :develop or similar image if we want it
  • Use yarn now that we've switched to it
  • Misc improvements (layer reduction, docs, etc)

@turt2live turt2live requested a review from a team April 10, 2019 21:56
@jryans jryans self-requested a review April 11, 2019 09:19
Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks reasonable to me overall! 😁

How would publishing to Docker Hub work? Will we add that to our release steps for official releases, or...?


To build the image yourself:
```bash
git clone https://github.com/vector-im/riot-web.git riot-web
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checkout directory will default to riot-web, so the last argument here isn't needed.

The Docker image can be used to serve riot-web as a web server. The easiest way to use
it is to use the prebuilt image:
```bash
docker run -p 80:80 vectorim/riot-web
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is vectorim an existing account on Docker Hub already? It seems like matrixdotorg does exist, but vectorim does not... I agree it likely makes sense for Riot to be in a separate vectorim-like account, but we should create it first before publishing these docs if it hasn't been done yet. (Also, would newvector or something be better...?)

It's also quite possible vectorim already does exist and I just don't understand Docker Hub at all. 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm the best at including relevant details and omitted the plan here, sorry. The plan is to nag people internally for opinions first and then merge this

@turt2live
Copy link
Member Author

How would publishing to Docker Hub work? Will we add that to our release steps for official releases, or...?

It'll magically work, once I set it up. Docker hub does builds for us (although they are painfully slow) and can be matched to branches and such. At worst we'll have to make sure that the riot-web push is the last one of the 3 repos or it'll end up building the wrong version.

WORKDIR /src

COPY . /src
RUN dos2unix /src/scripts/docker-link-repos.sh && sh /src/scripts/docker-link-repos.sh

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes no sense to convert it during the docker build. This should be done before adding it to the repository.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is committed with the right line endings, but Windows tends to not care once it is on disk.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case it's not Windows but git on Windows that has automatic line conversion enabled. This should be fixable by telling git to not modify them:

# .gitattributes
*.sh		text eol=lf

For details see: https://git-scm.com/docs/gitattributes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried everything in the book, trust me.

@turt2live turt2live self-assigned this Apr 15, 2019
@turt2live
Copy link
Member Author

Merging in hopes that it triggers a build

@turt2live turt2live merged commit 9957149 into develop May 1, 2019
@turt2live turt2live deleted the travis/dockerfile-continued branch May 1, 2019 16:42
@turt2live turt2live restored the travis/dockerfile-continued branch May 3, 2019 17:43
@turt2live turt2live mentioned this pull request May 3, 2019
@turt2live turt2live deleted the travis/dockerfile-continued branch May 3, 2019 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docker image
4 participants