Skip to content

Conversation

@fabiangabel
Copy link
Contributor

There seem to be two issues that come up with the current docker-compose routine, i.e. when creating the container via:

sudo docker build --tag webwork-base:forWW217 -f DockerfileStage1 . && sudo docker-compose build && sudo docker-compose up
  • Syntax: Missing backtick in docker-entrypoint.sh
app_1  | /usr/local/bin/docker-entrypoint.sh: line 180: unexpected EOF while looking for matching ``'
  • Dependencies: docker-compose complains about Email::Stuffer missing
app_1  | AH00526: Syntax error on line 60 of /etc/apache2/conf-enabled/webwork.conf:
app_1  | Can't locate Email/Stuffer.pm in @INC (you may need to install the Email::Stuffer module) (@INC contains: /opt/webwork/pg/lib /opt/webwork/webwork2/lib /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /etc/apache2) at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/ProblemUtil/ProblemUtil.pm line 47.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/ProblemUtil/ProblemUtil.pm line 47.\nCompilation failed in require at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 19.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 19.\nCompilation failed in require at /usr/share/perl/5.30/base.pm line 137.\n\t...propagated at /usr/share/perl/5.30/base.pm line 159.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/ShowMeAnother.pm line 18.\nCompilation failed in require at (eval 420) line 1.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK.pm line 88.\nCompilation failed in require at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 37.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 37.\n

Copy link
Member

@drgrice1 drgrice1 left a comment

Choose a reason for hiding this comment

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

This looks good.

Copy link
Member

@taniwallach taniwallach left a comment

Choose a reason for hiding this comment

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

The corrections all seem correct, and I was able to build using the revised DockerfileStage1 and to get the container to start (and course pages to work) using the corrected docker-config/docker-entrypoint.sh.

I'm not sure why there is an active ADD_APT_PACKAGES line in docker-compose.yml. That seems to have crept in as part of #1435 but using that slows down the container startup time significantly. I would tend to recommend that it be commented out by default. People who need such packages might want to modify their DockerfileStage2 to add extra packages instead. Fixing this can wait.

@drgrice1
Copy link
Member

@taniwallach: I am not sure that it crept in. You and @mgage had a discussion about that. See #1435 (comment).

@taniwallach
Copy link
Member

@taniwallach: I am not sure that it crept in. You and @mgage had a discussion about that. See #1435 (comment).

Sorry - you are correct. I did not review the history / conversation carefully, just tried to determine in which PR where it came in. I even was the one to merge that PR, as I guess @mgage convinced me that the approach was reasonable, and users could comment it out if the delay was annoying.

As someone who starts/stops Docker containers frequently, both when doing development and for maintenance on productions servers running WW inside Docker - I think keeping container startup time down is quite important.

A better long term solution might be to add conditional code so that extra packages like nano would be installed as part of the image build process, which would leave the ADD_APT_PACKAGES as a fallback approach when something is needed only short-term in the "next" running container.

Let's get these urgent fixes merged, and decide later about how to better add packages helpful for developers and not mission critical on development servers.

@taniwallach taniwallach merged commit 8e8aeab into openwebwork:develop Mar 24, 2022
@fabiangabel fabiangabel deleted the fix-docker-compose branch March 24, 2022 18:45
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