Користувальницькькі налаштування

Налаштування сайту


software:docker:tips

Це стара версія документу!


Short docker info

docker container ls --filter "status=running" --format 'table {{.ID}}\t{{.Names}}\t{{.Status}}\t{{.Image}}'

Show path to container log

docker inspect container_name|grep LogPath

Security: pull images

Once a week stop using caching and update all layers (–pull –no-cache):

docker build --pull --no-cache -t image-tag .

Python multistage builds

``` # base FROM python:3.8.3 as base COPY ./requirements.txt / RUN pip wheel –no-cache-dir –no-deps –wheel-dir /wheels -r requirements.txt

# stage FROM python:3.8.3-slim RUN apt-get update && \

  apt-get -y install netcat && \
  apt-get clean

WORKDIR /usr/src/app COPY –from=base /wheels /wheels COPY –from=base requirements.txt . RUN pip install –no-cache /wheels/* COPY . /usr/src/app CMD gunicorn -b 0.0.0.0:5000 manage:app ```

software/docker/tips.1620896059.txt.gz · Востаннє змінено: 2021/05/13 11:54 повз charon