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

Linux Docker container has warning about missing lib directory #2363

Closed
TheCakeIsNaOH opened this issue Sep 17, 2021 · 0 comments · Fixed by #2365
Closed

Linux Docker container has warning about missing lib directory #2363

TheCakeIsNaOH opened this issue Sep 17, 2021 · 0 comments · Fixed by #2365
Labels
5 - Released BuildAutomation NO RELEASE NOTES Should not be included in the release notes - not enhancing or fixing end product.
Milestone

Comments

@TheCakeIsNaOH
Copy link
Member

What You Are Seeing?

When running choco in the linux docker container, it complains about not being able to find the $env:chocolateyInstall/lib directory.

After installing a package, the warning disappears, since the lib directory has been created.

What is Expected?

That it does not display a warning about that.

How Did You Get This To Happen? (Steps to Reproduce)

  1. Build mono-choco docker container
  2. Run container
  3. Run choco

Suggested fix

Pre-create the lib directory inside the dockerfile

Output Log

Full Log Output

Chocolatey v0.11.1-10-g2f554cbf
Unable to set trace logging:
 Object reference not set to an instance of an object
Chocolatey is running on Linux v 5.10.0.0
Attempting to delete file "usr/local/src/choco/code_drop/chocolatey/console/chocolatey.dll.old".
Attempting to delete file "/opt/chocolatey/choco.exe.old".
Attempting to create directory "/opt/chocolatey/helpers".
Attempting to create directory "/opt/chocolatey/helpers/functions".
Attempting to create directory "/opt/chocolatey/redirects".
Attempting to create directory "/opt/chocolatey/tools".
Command line: /opt/chocolatey/choco.exe --verbose --debug --trace --allow-unofficial
Received arguments: --verbose --debug --trace --allow-unofficial
RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
Sending message 'PreRunMessage' out if there are subscribers...
[Pending] Removing all pending packages that should not be considered installed...
Directory '/opt/chocolatey/lib' does not exist.
Sending message 'PostRunMessage' out if there are subscribers...
Not able to cleanup NuGet temp folders. Failure was Path to combine cannot be empty. Tried to combine null with ''. Method called from 'delete_directory'
Exiting with 1

TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Sep 17, 2021
Rework the Dockerfile for Linux. Move to a multi-stage build so the
source code is not brought along into the final image (chocolatey#2364). Add
build args to select the build script and mono version to use. Remove
deprecated MAINTAINER instruction and add metadata with LABEL (chocolatey#2361).
Add "choco.exe" to path, so both "choco" and "choco.exe" can be used,
like Windows supports (chocolatey#2362). Change the install location to
"/opt/chocolatey" as that is more in line with the Linux filesystem
hierarchy (chocolatey#2360). Create the "lib" directory to prevent the warning
about the directory not being found (chocolatey#2363).

The choco_official_wrapper is used for official builds, where the
"--allow-unofficial" argument is not needed.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Sep 17, 2021
Rework the Dockerfile for Linux. Move to a multi-stage build so the
source code is not brought along into the final image (chocolatey#2364). Add
build args to select the build script and mono version to use. Remove
deprecated MAINTAINER instruction and add metadata with LABEL (chocolatey#2361).
Add "choco.exe" to path, so both "choco" and "choco.exe" can be used,
like Windows supports (chocolatey#2362). Change the install location to
"/opt/chocolatey" as that is more in line with the Linux filesystem
hierarchy (chocolatey#2360). Create the "lib" directory to prevent the warning
about the directory not being found (chocolatey#2363).

The choco_official_wrapper is used for official builds, where the
"--allow-unofficial" argument is not needed.
@gep13 gep13 added this to the vNext milestone Sep 17, 2021
gep13 pushed a commit to TheCakeIsNaOH/choco that referenced this issue Sep 17, 2021
Rework the Dockerfile for Linux. Move to a multi-stage build so the
source code is not brought along into the final image (chocolatey#2364). Add
build args to select the build script and mono version to use. Remove
deprecated MAINTAINER instruction and add metadata with LABEL (chocolatey#2361).
Add "choco.exe" to path, so both "choco" and "choco.exe" can be used,
like Windows supports (chocolatey#2362). Change the install location to
"/opt/chocolatey" as that is more in line with the Linux filesystem
hierarchy (chocolatey#2360). Create the "lib" directory to prevent the warning
about the directory not being found (chocolatey#2363).

The choco_official_wrapper is used for official builds, where the
"--allow-unofficial" argument is not needed.
@gep13 gep13 added 4 - Done NO RELEASE NOTES Should not be included in the release notes - not enhancing or fixing end product. and removed 3 - Review labels Sep 17, 2021
@gep13 gep13 closed this as completed Sep 17, 2021
gep13 pushed a commit that referenced this issue Sep 21, 2021
Rework the Dockerfile for Linux. Move to a multi-stage build so the
source code is not brought along into the final image (#2364). Add
build args to select the build script and mono version to use. Remove
deprecated MAINTAINER instruction and add metadata with LABEL (#2361).
Add "choco.exe" to path, so both "choco" and "choco.exe" can be used,
like Windows supports (#2362). Change the install location to
"/opt/chocolatey" as that is more in line with the Linux filesystem
hierarchy (#2360). Create the "lib" directory to prevent the warning
about the directory not being found (#2363).

The choco_official_wrapper is used for official builds, where the
"--allow-unofficial" argument is not needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Released BuildAutomation NO RELEASE NOTES Should not be included in the release notes - not enhancing or fixing end product.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants