Skip to content

Config generation at runtime + buildtime #529

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

Merged
merged 1 commit into from
Sep 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NodeBase/entry_point.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

source /opt/bin/functions.sh
/opt/bin/generate_config > /opt/selenium/config.json
Copy link
Member

Choose a reason for hiding this comment

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

NodeBase doesn't have a generate_config this would fail, no?

Copy link
Contributor Author

@Remi-p Remi-p Aug 8, 2017

Choose a reason for hiding this comment

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

Before the commit 0dd193a (Moving config generation in docker files) the line was here.

I believe that it's because NodeBase is not runned directly, it's used in other images that have generate_config.


For instance for Chrome.
In NodeBase Dockerfile.txt, the entry point is set :

CMD ["/opt/bin/entry_point.sh"]

It calls entry_point.sh which calls for generate_config.

In NodeChrome Dockerfile.txt, the generate_config file is copyied inside the image, before the entrypoint is called :

COPY generate_config /opt/bin/generate_config

So when the image is launched, the entrypoint is called, and it can generate the config because generate_config is in the image.


export GEOMETRY="$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH"

Expand Down
2 changes: 1 addition & 1 deletion NodeChrome/Dockerfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ COPY generate_config /opt/bin/generate_config
#=================================
COPY chrome_launcher.sh /opt/google/chrome/google-chrome

# Generating config inside the image rather than with entry_point.sh
# Generating a default config during build time
RUN /opt/bin/generate_config > /opt/selenium/config.json
1 change: 1 addition & 0 deletions NodeChromeDebug/entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# IMPORTANT: Change this file only in directory NodeDebug!

source /opt/bin/functions.sh
/opt/bin/generate_config > /opt/selenium/config.json

export GEOMETRY="$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH"

Expand Down
1 change: 1 addition & 0 deletions NodeDebug/entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# IMPORTANT: Change this file only in directory NodeDebug!

source /opt/bin/functions.sh
/opt/bin/generate_config > /opt/selenium/config.json

export GEOMETRY="$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH"

Expand Down
2 changes: 1 addition & 1 deletion NodeFirefox/Dockerfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ COPY generate_config /opt/bin/generate_config
# When logging into the container
RUN sudo echo ""

# Generating config inside the image rather than with entry_point.sh
# Generating a default config during build time
RUN /opt/bin/generate_config > /opt/selenium/config.json
1 change: 1 addition & 0 deletions NodeFirefoxDebug/entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# IMPORTANT: Change this file only in directory NodeDebug!

source /opt/bin/functions.sh
/opt/bin/generate_config > /opt/selenium/config.json
Copy link
Member

Choose a reason for hiding this comment

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

Would these lines replace the RUN /opt/bin/generate_config > /opt/selenium/config.json lines? or would they be supplemental

Copy link
Contributor Author

@Remi-p Remi-p Aug 8, 2017

Choose a reason for hiding this comment

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

I think they should both exist.
The RUN directive would create a default configuration file, and the generate_config from the entry_point.sh will allow to customize environment variables.

This is actually done for the hub : Hub/Dockerfile#L39 & Hub/entry_point.sh#L6


export GEOMETRY="$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH"

Expand Down