howto_build_an_own_docker_image

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
howto_build_an_own_docker_image [2021/06/27 23:17] – [HowTo build a Docker Image] homerhowto_build_an_own_docker_image [2021/06/29 00:02] (aktuell) homer
Zeile 4: Zeile 4:
  
  * Use the latest ubuntu docker-image from hub.docker.com  * Use the latest ubuntu docker-image from hub.docker.com
-   because I need the recent libolm3 and libolm-dev +   as I need the recent libolm3 and libolm-dev 
- * I need to+ In my git repository created 
 +   * the _.dockerignore_ file  
 + * as well as the subfolder _docker_ in which I created 
 +   * the _Dockerfile_ and 
 +   * the _docker-compose.yml_. 
 + 
 +### Dockerfile 
 ``` ```
-   apt update +# syntax=docker/dockerfile:
-   apt install python3-venv libolm-dev emacs-nox build-essential python3-pip python3-openssl ffmpeg + 
-   * adduser experiments --home /home/experiments --disabled-password +FROM ubuntu:latest 
-   * experiments:experiments | chpasswd + 
-   * su -l experiments +ENV TZ=Europe/Berlin 
-     * mkdir /home/experiments/applications  +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone 
-     * python3 -m venv /home/experiments/applications + 
-     * source /home/experiments/applications/bin/activate+WORKDIR /app 
 +VOLUME /app 
 + 
 +COPY . . 
 + 
 +RUN ls -la 
 +RUN ["cat", "/app/requirements.txt"
 + 
 +RUN /bin/bash -c 'apt update && apt install -libolm-dev python3-pip ffmpeg;' 
 + 
 + 
 +RUN pip install update pip && pip install -r requirements.txt 
 + 
 + 
 +CMD python3 fritzab2matrix.py && tail -/dev/null 
 + 
 ``` ```
-I have to run +**docker-compose.yml**
 ``` ```
-python3 matrix-commander.py+version: "3.7" 
 + 
 +services: 
 +  app: 
 +    container_name: "fritzab2matrix" 
 +    build: 
 +      context: ../. 
 +      dockerfile: ./docker/Dockerfile 
 +    working_dir: /app 
 +    volumes: 
 +      - ./:/app 
 + 
 ``` ```
- before it will work with my own script, because it needs to setup the storage with my login data and the room to post to.+**.dockerignore** 
 +``` 
 +*~ 
 +docker-compose.yml
  
 +```
  
 </markdown> </markdown>
  • howto_build_an_own_docker_image.1624828631.txt.gz
  • Zuletzt geändert: 2021/06/27 23:17
  • von homer