I was create flask-app and deploy it using docker, i deploy manually in mac and success, this is my Dockerfile script :
# start by pulling the python image
FROM python:3.8-alpine
# copy the requirements file into the image
COPY ./requirements.txt /app/requirements.txt
# switch working directory
WORKDIR /app
# install the dependencies and packages in the requirements file
RUN pip3 install -r requirements.txt
# copy every content from the local file to the image
COPY . /app
EXPOSE 1201
# execute the Flask app
CMD ["python3", "run.py"]
and i try to automatic deploy using github actions, and it is my YML script :
name: Docker Image CI
on:
push:
branches: [ "new-feature" ]
pull_request:
branches: [ "new-feature" ]
jobs:
build:
runs-on: macos-latest
steps:
- name: instal docker colima
run: |
brew install docker
colima start
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build --tag my_image2 .
- name: run docker image
run: docker run -d -p 1201:1201 my_image2
and i think all working well, images built successfully :
Step 7/7 : CMD ["python3", "run.py"]
---> Running in f0144a0c80f6
Removing intermediate container f0144a0c80f6
---> d068026c42b0
Successfully built d068026c42b0
Successfully tagged my_image2:latest
and then i check my image not exist, in docker even in colima
So what the problem, and you guys can give me a solution ? thank you