AspNetCore:2.1 not found - docker

Created a new .NET CORE 2.1 (preview) web app. Running it in local docker with Linux container
I am getting compiler error:
Error Building blobtest
Service 'blobtest' failed to build: manifest for microsoft/aspnetcore:2.1 not found.
My dotnetversion
C:\WINDOWS\system32>dotnet --version
2.1.300-preview2-008530

They have changed the repo for .NET Core 2.1 onwards to microsoft/dotnet.
Change your FROM statement to reference microsoft/dotnet using the following tags:
2.1-sdk
2.1-aspnetcore-runtime
2.1-runtime
Documentation on how to upgrade can be found here

I had this issue as well. I thought I'd update this post to show the fix here. Thanks to Marius Bidireac for the link to the resource.
Here is an excerpt from the original docker file
FROM microsoft/aspnetcore:2.0 AS base
FROM microsoft/aspnetcore-build:2.0 AS build
Here is an excerpt from the corrected docker file
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
FROM microsoft/dotnet:2.1-sdk AS build

If you are using GitLab CI, then these images don't work—maybe because they changed the names of the images again. See official page on Docker.
If I used the labels suggested by this answer,
image: microsoft/dotnet:2.2
Then, it kept giving the errors,
manifest for microsoft/dotnet:2.2 not found
Solution to this was to use the recent naming convention provided by Microsoft. Please see the Docker link I provided above. In my GitLab CI (.gitlab-ci.yml) file I used the following and it worked,
image: mcr.microsoft.com/dotnet/core/sdk:2.2
Now the build pipeline succeeds just fine.

Related

How to use Docker BuildKit extensions in GitHub Actions

I'm trying to do something a bit slick, and of course running into issues.
Specifically, I am using a Docker-based environment build system (Lando). I'm feeding it a Dockerfile that it then builds a cluster around, using docker-compose. Locally, this works fine. I also have it working great inside a GitHub Action to spin up a local-dev-identical environment for testing. Quite nice.
However, now I'm trying to expand the Dockerfile using the Dockerfile Plus extension. My Dockerfile looks like this:
# syntax = edrevo/dockerfile-plus
INCLUDE+ ./docker/prod/Dockerfile
COPY docker/dev/php.ini /usr/local/etc/php/conf.d/zzz-docker-custom.ini
# Other stuff here.
This works great for me locally, and I get the contents of docker/prod/Dockerfile included into my docker build.
When I run the same configuration inside a GitHub Actions workflow, I get a syntax error on the INCLUDE+ line, indicating that the extension is not being loaded. It uses BuildKit (according to the project page), which should be enabled by default on any recent Docker version, it says. Yet whatever is on GitHub is not using BuildKit. I've tried enabling it by setting the env vars explicitly (as specified on the Dockerfile+ project page), but it still doesn't seem to work.
How can I get Dockerfile+ working in GitHub Actions? Of note, I do not run the docker build command myself (it's run by docker-compose, using files generated on the fly by Lando), so I cannot modify that specific command. But I didn't need to locally anyway, so I don't know what the issue is.

Cannot create docs for components in backstage docker error

I am trying to display docs stored in repository created by backstage io component on backstage-io /docs page UI, but when I am trying to access the docs I am getting the following error
Building a newer version of this documentation failed. Error: "Failed to generate docs from C:\\Users\\Admin\\AppData\\Local\\Temp\\backstage-enprxk into C:\\Users\\Admin\\AppData\\Local\\Temp\\techdocs-tmp-W6iVab; caused by Error: Docker container returned a non-zero exit code (1)"
Files in my repository
docs folder only having index.md
and mkdocs.yml have
nav:
Home: index.md
I was getting similar issues working on a local POC of Backstage. The biggest problem was that I needed to install pip, python, mkdocs, and mkdocs-techdocs-core (i.e. pip3 install mkdocs-techdocs-core). If you have done that and then followed everything in this documentation, then it should start working. Hope that helps. I spent a couple of days trying to get past these types of errors.
For me the above issue is fixed by using below as it was not working inside my container in kubernetes.
I changed app-config.yaml -
techdocs:
builder: 'local' # Alternatives - 'external'
generator:
runIn: 'local' // changed from docker to local here

Docker | Error by creation a Docker Image in Azure DevOps with VS 2019

I am new in the Docker-World and i struggle very hard to create a Docker Image in Azure DevOps.
So First i created a Angular ASP.NET Core 2.2 Webapplication on VS 2019.
Then i committed this in Azure DevOps & configure the Pipline for manuell or automatic build process which create a docker image.
After then i create a Docker file in VS2019 -> Project -> ADD Docker Support -> Linux.
Conclusion when i start my pipeline so I get this error
COPY failed: stat
/var/lib/docker/tmp/docker-builder088029891/WebapplicationTestLinuxDocker/WebapplicationTestLinuxDocker.csproj:
no such file or directory /usr/bin/docker failed with return code: 1
Projectstructure:
My Docker File looks like:
And my .dockerignore have this:
I thank you in advance and I hope you can help me! :)
the source paths are relative to the Dockerfile. So in your Dockerfile it says:
["WebapplicationTestLinuxDocker/WebapplicationTestLinuxDocker.csproj","WebapplicationTestLinuxDocker/"]
change it to:
["WebapplicationTestLinuxDocker.csproj","WebapplicationTestLinuxDocker/"]
then go down two lines and where it says:
COPY . .
change it to:
COPY . WebapplicationTestLinuxDocker/
Hope that works!
Tim
Tray this:
copy ./path/path path
btw I did not see your file in the screenshot :)
Keep the docker file on the solution folder level instead of inside the project.

Elixir: Could not find application file: runtime_tools.app

I am using Docker to develop an Elixir umbrella app. I have one umbrella app and inside a Phoenix app. When I start the code locally with mix phx.server everything works. When I do the same inside the Docker container (code is synced via docker-sync) I get this error:
(Mix) Could not start application runtime_tools: could not find application file: runtime_tools.app
Any idea on how to fix this?
Turns out erlang-runtime-tools was not installed in my docker image. Adding
RUN apk --update add erlang-runtime-tools
to the dockerfile fixed the issue. Thanks #Alexei Sholik for pointing this out.

How to start Mountebank in Docker?

How can I use Docker to start Mountebank as a server? I am following this tutorial but I can't make it work.
This error appears:
warn: [mb:2525] dry running injection, use the isDryRun request field in your JavaScript to ignore...
error: [mb:2525] injection X=> SyntaxError: Unexpected token e
error: [mb:2525] source: "(function(request, logger) { return JSON.parse(request.data).hasOwnProperty('state'); })(scope, logger);"
error: [mb:2525] scope: {"requestFrom":"","data":"test","isDryRun":true}
The project is open source and CI is Travis. I have cross-posted this discussion to the Mountebank mailing list.
The problem appears to be that the base Docker image is using an old version of mountebank (v1.2.122). I'm not super familiar with Docker, but I assume it's caching the image originally built by Conrad. Your config file works fine with the latest version of mountebank; that just needs to be installed in the Docker container. - https://groups.google.com/forum/#!topic/mountebank-discuss/m-UrVZBR1sQ

Resources