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

docs: Add Dockerfile and docker build instructions #3547

Merged
merged 1 commit into from
Mar 21, 2022

Conversation

juninhocruzg3
Copy link
Contributor

@juninhocruzg3 juninhocruzg3 commented Jul 25, 2021

add docker-compose.yml and Dockerfile to compile shaka inside container; reference it on docs;

Description

Many devs using Shaka and wishing to compile the library are required to install all prerequisites on their machine. For docker devs, this is extremely bad as it requires installing Java and Python on OS.
This commit adds a basic configuration for quick compilation via Docker, without requiring any other prerequisites. Improvements can be made in order to allow all Shaka workflow inside Docker.
Suggested in #181

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update

Checklist:

  • I have signed the Google CLA https://cla.developers.google.com
  • My code follows the style guidelines of this project
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works [not applicable/not auto-testable]
  • I have verified my change on multiple browsers on different platforms
  • I have run ./build/all.py and the build passes
  • I have run ./build/test.py and all tests pass

BEGIN_COMMIT_OVERRIDE
feat: Add Dockerfile and docker build instructions
END_COMMIT_OVERRIDE


################
# TODO: A good practice to apply here in this code is:
# run container as a non-root user. However, an error is
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for contributing!

It seems like it should be relatively okay to run commands in this very temporary container as root. But it still bothers me that there is an error from generateLocalizations.py.

Can you provide details of the error? I'd like to try to help you solve it so that we can adopt a non-root solution here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I apologize for the delay in providing the error.
Proceeding the contribution, here's the error I get in non-root mode:

Successfully tagged docker_shaka-compiler:latest
Creating shaka-compiler ... done
Attaching to shaka-compiler
shaka-compiler    | Traceback (most recent call last):
shaka-compiler    |   File "/usr/src/app/build/all.py", line 150, in <module>
shaka-compiler    |     shakaBuildHelpers.run_main(main)
shaka-compiler    |   File "/usr/src/app/build/shakaBuildHelpers.py", line 374, in run_main
shaka-compiler    |     sys.exit(main(sys.argv[1:]))
shaka-compiler    |   File "/usr/src/app/build/all.py", line 92, in main
shaka-compiler    |     if not localizations.generate(parsed_args.force):
shaka-compiler    |   File "/usr/src/app/build/compiler.py", line 512, in generate
shaka-compiler    |     generateLocalizations.main(['--locales'] + locales)
shaka-compiler    |   File "/usr/src/app/build/generateLocalizations.py", line 255, in main
shaka-compiler    |     with open(args.output, 'wb') as f:
shaka-compiler    | FileNotFoundError: [Errno 2] No such file or directory: '/usr/src/app/dist/locales.js'
shaka-compiler exited with code 1

This time, I'll follow the github notifications in order to haven't a delay again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@joeyparrish , Is there any risk of this pull request being closed for update timeout or shouldn't I worry about time? Is there anything I can do in order to help to proceed this PR?

@juninhocruzg3 juninhocruzg3 force-pushed the docker-compiler branch 2 times, most recently from 0fc7c5b to 27e8b57 Compare March 19, 2022 05:23
@juninhocruzg3
Copy link
Contributor Author

I finally solved the problem to run as non-root user. @joeyparrish, I need a new review. No update is needed on my pull request:

add docker-compose.yml and Dockerfile to compile shaka inside container; reference it on docs;

Description

Many devs using Shaka and wishing to compile the library are required to install all prerequisites on their machine. For docker devs, this is extremely bad as it requires installing Java and Python on OS.
This commit adds a basic configuration for quick compilation via Docker, without requiring any other prerequisites. Improvements can be made in order to allow all Shaka workflow inside Docker.
Suggested in #181

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update

Checklist:

  • I have signed the Google CLA https://cla.developers.google.com
  • My code follows the style guidelines of this project
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works [not applicable/not auto-testable]
  • I have verified my change on multiple browsers on different platforms
  • I have run ./build/all.py and the build passes
  • I have run ./build/test.py and all tests pass

Many devs using Shaka and wishing to compile the library are required to install all prerequisites on their machine. For docker devs, this is extremely bad as it requires installing Java and Python on OS.
This commit adds a basic configuration for quick compilation via Docker, without requiring any other prerequisites. Improvements can be made in order to allow all Shaka work flow inside Docker.
Copy link
Member

@joeyparrish joeyparrish left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks!

@joeyparrish joeyparrish changed the title feat: add Shaka build inside docker container feat: Add Dockerfile and docker build instructions Mar 21, 2022
@joeyparrish joeyparrish changed the title feat: Add Dockerfile and docker build instructions docs: Add Dockerfile and docker build instructions Mar 21, 2022
@joeyparrish joeyparrish merged commit 925de19 into shaka-project:main Mar 21, 2022
joeyparrish added a commit that referenced this pull request Apr 21, 2022
Roll-up and backport of PRs #3547, #4043, and #4078
joeyparrish added a commit that referenced this pull request Apr 21, 2022
Roll-up and backport of PRs #3547, #4043, and #4078
joeyparrish added a commit that referenced this pull request Apr 21, 2022
Roll-up and backport of PRs #3547, #4043, and #4078
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants