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

Docker fixups #3125

Merged
merged 4 commits into from
Nov 22, 2023
Merged

Docker fixups #3125

merged 4 commits into from
Nov 22, 2023

Conversation

nickanderson
Copy link
Member

@nickanderson nickanderson commented Nov 22, 2023

I tried the docker build and failed. These changes are my quick try for improvement.

  • Tidied documentation for readability
  • Added clone.sh script to make it easier to get the necessary repos
  • Moved installation of execjs before redcarpet to avoid pulling it in with the wrong version as a dependency
Building native extensions.  This could take a while...
unable to convert "\xC3" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for COPYING, skipping
unable to convert "\xC3" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for COPYING, skipping
Successfully installed redcarpet-2.2.2
1 gem installed
Installing ri documentation for redcarpet-2.2.2...
Installing RDoc documentation for redcarpet-2.2.2...
ERROR:  Error installing uglifier:
        execjs requires Ruby version >= 2.5.0.
The command '/bin/sh -c bash -x /install.sh' returned a non-zero code: 1

Installing redcarpet tried to pull in a newer version of execjs which wanted
newer ruby. This simply makes sure that execjs is installed at our needed
version first.
@nickanderson
Copy link
Member Author

Still not fully working. Running main.sh in the container fails:

export BRANCH=master
export PACKAGE_JOB=testing-pr
export PACKAGE_UPLOAD_DIRECTORY=jenkins-master-nightly-pipeline-1420
export PACKAGE_BUILD=1
docker run --rm -it -v $PWD:/nt docs bash -x documentation/generator/build/main.sh $BRANCH $PACKAGE_JOB $PACKAGE_UPLOAD_DIRECTORY $PACKAGE_BUILD
-rw-r--r--  1 jenkins jenkins  833 Nov 22 15:56 rvm-installer.asc
+ source ~/.rvm/scripts/rvm
documentation/generator/build/main.sh: line 117: -y: command not found

@nickanderson
Copy link
Member Author

I modified main.sh swapping out references to ubuntu 18 with ubuntu 22 to match the dockerfile. I then rebuilt the docker container and I was then able to docker run --rm -it -v $PWD:/nt docs bash -x documentation/generator/build/main.sh $BRANCH $PACKAGE_JOB $PACKAGE_UPLOAD_DIRECTORY $PACKAGE_BUILD

@nickanderson
Copy link
Member Author

nickanderson commented Nov 22, 2023

I am then able to load the site in firefox from the local files. CSS and JS don't load because of wrong path issue.
I munged the html directly to use ./assets/footer-4bc00c8165fa8a0939d6661cb0bd6f02.js instead of /docker/master/assets/footer-4bc00c8165fa8a0939d6661cb0bd6f02.js and on refresh things look prettier.

Copy link
Contributor

@craigcomstock craigcomstock left a comment

Choose a reason for hiding this comment

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

the changes look relatively harmless and if they improve the situation, cool.

@nickanderson
Copy link
Member Author

@cf-bottom jenkins, please

@nickanderson
Copy link
Member Author

Alrighty, this seems to work. So, merging.

@nickanderson nickanderson merged commit 17ff391 into cfengine:master Nov 22, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants