Building Docker Image And Run Custom Commands For Git Tagged Repository

1. docker domestic config and to avoid the frontend.v1 error:

2. structure and dockerfile, must be Dockerfile, or else should be specified by docker build -f "pathtodockerfile", -t for tag,

FROM python:3.7-alpine
WORKDIR
/code
ENV FLASK_APP app
.py
ENV FLASK_RUN_HOST
0.0.0.0
RUN apk add --no-cache gcc musl-dev linux-headers
COPY requirements
.txt requirements.txt
RUN pip install
-r requirements.txt
COPY
..
CMD ["flask","run"]

3. build command

4. see built image

5. run bash into built container by allocating a tty terminal in interactive mode, specify name first: docker run --name cdockertest1 -it cdockertest:v1.0 /bin/bash

6. docker run -d --name cdockertest1, this will start a container for the image,

docker ps -a, for viewing all containers,

docker exec -it cdockertest1 /bin/bash for entering running container

7. docker login, docker push, docker-compose.yml

8. docker login, docker pull, docker run

9. backup data

留下你的评论