From 0aed524608efcf922375ff23463199030c9d2011 Mon Sep 17 00:00:00 2001 From: Long Zhang Date: Thu, 13 Jul 2023 16:43:58 +0200 Subject: [PATCH] update doc, build image for multi-platforms --- .dockerignore | 3 +++ .github/workflows/python-app.yml | 4 ++-- Dockerfile | 3 ++- README.md | 2 +- deployment/k8s/deployment.yaml | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9fd3c91 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +**/__pycache__ +**/*.pyc +**/.DS_Store diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 76c99cf..68085d8 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -53,6 +53,6 @@ jobs: - name: Build and push uses: docker/build-push-action@v4 with: + platforms: linux/amd64,linux/arm64 push: true - tags: opensourceelectrolux/aws-cost-exporter:${{ github.ref_name }} - + tags: opensourceelectrolux/aws-cost-exporter:${{ github.ref_name }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index d4a9525..b8a63a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,8 @@ FROM python:3.10.11-alpine ENV APP_HOME /app WORKDIR / -COPY ./app *.py package.json requirements.txt / +COPY ./app $APP_HOME +COPY *.py package.json requirements.txt / RUN pip install -r requirements.txt ENV PYTHONUNBUFFERED 1 diff --git a/README.md b/README.md index 21cb46d..f6bb324 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Modify the `exporter_config.yaml` file first, then use one of the following meth ### Docker ``` -docker run --rm -v ./exporter_config.yaml:/app/exporter_config.yaml -p 9090:9090 -e AWS_ACCESS_KEY=${AWS_ACCESS_KEY} -e AWS_ACCESS_SECRET=${AWS_ACCESS_SECRET} opensourceelectrolux/finops-aws-cost-exporter:v1.0.0 +docker run --rm -v ./exporter_config.yaml:/app/exporter_config.yaml -p 9090:9090 -e AWS_ACCESS_KEY=${AWS_ACCESS_KEY} -e AWS_ACCESS_SECRET=${AWS_ACCESS_SECRET} opensourceelectrolux/aws-cost-exporter:v1.0.0 ``` ### Kubernetes diff --git a/deployment/k8s/deployment.yaml b/deployment/k8s/deployment.yaml index 7caf4dc..c94ac98 100644 --- a/deployment/k8s/deployment.yaml +++ b/deployment/k8s/deployment.yaml @@ -24,7 +24,7 @@ spec: spec: containers: - name: aws-cost-exporter - image: "opensourceelectrolux/finops-aws-cost-exporter:v1.0.0" + image: "opensourceelectrolux/aws-cost-exporter:v1.0.0" command: [ "python", "main.py", "-c", "/exporter_config.yaml" ] imagePullPolicy: Always env: