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

Local Docker Build does not work #263

Open
bart-vmware opened this issue May 31, 2022 · 5 comments
Open

Local Docker Build does not work #263

bart-vmware opened this issue May 31, 2022 · 5 comments
Assignees
Labels
documentation-pages Improvements or additions to documentation pages incorrect-instructions Text does not appear to be correct

Comments

@bart-vmware
Copy link
Member

Describe the bug

The instructions for running documentation from a docker container at the end of /README.md:

docker build -t steeltoe-docs .

docker run -d --name local-docs -p 8082:80 steeltoe-docs

Fail with the following error on my system:

C:\Source\Repos\Documentation> docker build -t steeltoe-docs .
[+] Building 4.5s (4/4) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                                              0.0s
 => => transferring dockerfile: 334B                                                                                                                                                                                                                                                                              0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                                                 0.0s
 => => transferring context: 60B                                                                                                                                                                                                                                                                                  0.0s
 => CANCELED [internal] load metadata for docker.io/library/nginx:1.19                                                                                                                                                                                                                                            4.4s
 => ERROR [internal] load metadata for steeltoe.azurecr.io/documentation-metadata:3.1.3-2.5.5-1                                                                                                                                                                                                                   4.0s
------
 > [internal] load metadata for steeltoe.azurecr.io/documentation-metadata:3.1.3-2.5.5-1:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to authorize: rpc error: code = Unknown desc = failed to fetch anonymous token: unexpected status: 401 Unauthorized

Expected behavior

The commands to succeed without error.

Environment (please complete the following information, if applicable):

  • Platform: PowerShell v7.2.4
  • OS Version: Windows 10 x64
@bart-vmware bart-vmware added incorrect-instructions Text does not appear to be correct documentation-pages Improvements or additions to documentation pages labels May 31, 2022
@bart-vmware
Copy link
Member Author

Instructions were recently updated in 2ce2033:

docker compose up

This fails with the next error on my system:

C:\Source\Repos\Documentation> docker compose up
[+] Running 0/1
 - mainsite Error                                                                                                                                                                                                                                                                                                 3.9s
Error response from daemon: Head "https://steeltoe.azurecr.io/v2/mainsite/manifests/latest": unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information.

@ccheetham Do you know how to fix this?

@bart-vmware
Copy link
Member Author

Assuming that docker compose cannot work for anonymous users (I don't know if that's true), we may want to restore the steps to build outside of docker by running build-metadata.sh. I haven't tried this, as I'm not sure how to run the bash script on Windows. Another option might be to convert it to PowerShell, which works on all platforms.

@ccheetham ccheetham self-assigned this May 31, 2022
@ccheetham
Copy link
Contributor

ccheetham commented May 31, 2022

The steeltoe.azurecr.io registry is a private, hosted in our Azure instance:

https://portal.azure.com/#@dotnetfoundation.org/resource/subscriptions/997e7c30-fd83-4b3d-bcf5-492e194f9b98/resourceGroups/Steeltoe/providers/Microsoft.ContainerRegistry/registries/steeltoe/repository

We could outline the steps to authenticate in the README, even though most developers will not be able to authenticate.

A second option is to use a public registry.

Here are the steps to authenticate:

@TimHess
Copy link
Member

TimHess commented Feb 15, 2024

@bart-vmware are you satisfied with the state of this as we merge #310?

@bart-vmware
Copy link
Member Author

bart-vmware commented Feb 16, 2024

Found the next issues in README.md (already merged to main):

  • Duplicate text:

    An example API document:

    An example API doc:

  • Download from DocFX: "distribution" should not link to the latest docfx version. On Windows, installation is much simpler using: choco install docfx -y --version 2.59.2
  • Building and running the docker container fail with errors
  • Build API docs: Tons of warnings along the lines of: "method not found" and "does not contain any documents". I tried to fix it by building first:
    dotnet build .\sources\v2\src\Steeltoe.All.sln --configuration Release
    dotnet build .\sources\v3\src\Steeltoe.All.sln --configuration Release
    
    However, build of v2 fails with:
    C:\Source\Repos\Documentation\sources\v2\src\Connectors\test\GemFireConnector.Net4Test\GemFireAuth\BadConstructorAuthInitializer.cs(5,7): error CS0246: The type or namespace name 'Apache' could not be found (are you missing a using directive or an assembly reference?) [C:\Source\Repos\Documentation\sources\v2\src\Connectors\test\GemFireConnector.Net4Test\Steeltoe.CloudFoundry.GemFireConnector.Test.csproj::TargetFramework=net461]
    
    I don't remember how to build v2 from source successfully. I don't know how to get rid of the warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation-pages Improvements or additions to documentation pages incorrect-instructions Text does not appear to be correct
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants