0

I have .NET Core 2.0 application with Docker support. The Dockerfile is:

FROM microsoft/aspnetcore-build:2.0 AS build-env WORKDIR /app

COPY . ./                                           
RUN dotnet publish -c Release -o out

FROM microsoft/aspnetcore:2.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "Myapp.dll"]

The docker-compose.yml is:

version: '3'

services:
  myapp:
    build:
      context: ./Myapp
      dockerfile: Dockerfile
    ports: 
      - "8000:8000"

I'm trying to execute docker-compose build and receive the next error:

FROM requires exactly one argument

Please advise what can be the issue. I'm not familiar with docker at all. I have two projects in /app folder with similar Dockerfile. The first project build is successful, but the second project fails.

Screenshot: 1

2 Answers 2

2

You mixed two instructions in one line

FROM microsoft/aspnetcore-build:2.0 AS build-env WORKDIR /app

Should be

FROM microsoft/aspnetcore-build:2.0 AS build-env 
WORKDIR /app
Sign up to request clarification or add additional context in comments.

Comments

0

I think the question is answered already above, but here's another option: Build your .NET Core 2.0 applications on OpenShift. It's awesome! No Dockerfiles, etc. needed and you get all the Kubernetes goodness free. Red Hat's Container Development Kit is open source and brings OpenShift right to your desktop. Just food for thought.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.