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

Worker App build error #324

Open
vamagithub opened this issue Dec 8, 2023 · 9 comments
Open

Worker App build error #324

vamagithub opened this issue Dec 8, 2023 · 9 comments

Comments

@vamagithub
Copy link

Description
docker compose up renders the following error while building an image for the worker app.

image

@Vincent990413
Copy link

Same issue encountered here, wondering if there is any help??

@Vincent990413
Copy link

Description 描述 docker compose up renders the following error while building an image for the worker app. docker compose up 在为工作应用程序构建图像时呈现以下错误。

image

Hi! Actually I just found some solutions, here is a new Yaml file which works. You might want to replace it into the older one.

apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres-deployment
labels:
app: demo-voting-app
spec:
replicas: 1
selector:
matchLabels:
name: postgres-pod
app: demo-voting-app
template:
metadata:
name: postgres-pod
labels:
name: postgres-pod
app: demo-voting-app
spec:
containers:
- name: postgres
image: postgres:9.4
env:
- name: POSTGRES_USER
value: postgres
- name: POSTGRES_PASSWORD
value: postgres
- name: POSTGRES_HOST_AUTH_METHOD
value: trust
ports:
- containerPort: 5432

@imluth
Copy link

imluth commented Jan 16, 2024

Same error for me as well, is it officially fixed now?

@Vincent990413
Copy link

Vincent990413 commented Jan 16, 2024 via email

@Vincent990413
Copy link

Vincent990413 commented Jan 16, 2024 via email

@imluth
Copy link

imluth commented Jan 16, 2024

can you share the repo with me please. thanks man

@Vincent990413
Copy link

Vincent990413 commented Jan 16, 2024 via email

@dcc6fvo
Copy link

dcc6fvo commented Mar 22, 2024

We manage to work:

docker-compose.yml

`

worker:
platform: linux/amd64
environment:
- DOCKER_DEFAULT_PLATFORM=linux/amd64
build:
args:
TARGETPLATFORM: linux/amd64
TARGETARCH: amd64
context: ./worker
depends_on:
redis:
condition: service_healthy
db:
condition: service_healthy
networks:
- back-tier
`

worker/Dockerfile:

`

FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/sdk:7.0 as build
ARG TARGETPLATFORM
ARG TARGETARCH
#ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

WORKDIR /source
COPY *.csproj .
RUN dotnet restore -a $TARGETARCH

COPY . .
RUN dotnet publish -c release -o /app -a $TARGETARCH --self-contained false --no-restore

# app image
FROM mcr.microsoft.com/dotnet/runtime:7.0
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT ["dotnet", "Worker.dll"]
`

@Vincent990413
Copy link

Vincent990413 commented Mar 22, 2024 via email

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

No branches or pull requests

4 participants