Karteikarten
4 Docker image
Karten in diesem Stapel (10)
- 1What are steps for creating say own Flask image on Ubuntu?1. OS Ubuntu
2. Update apt repo
3. Install dependencies using apt
4. Install Python dependencies using pip
5. Copy source code to /opt
6 Run web server using flask - 2Create a Docker file from previous flashcardFROM Ubuntu
RUN apt-get update
RUN apt-get install python
RUN pip install flask
RUN pip install flask-mysql
COPY ./opt/source-code
ENTRYPOINT FLASK_APP=/opt/source-code/app.py flask run - 3Build an image from Dockerfile and tag it myname/my-sutom-appdocker build Dockerfile -t myname/my-custom-app
- 4Push docker image to docker hubdocker push myname/cutom-app
- 5There is docker container simple-app. Run it with env variable APP_color assigning several colorsdocker run -e APP_COLOR=blue simple-app
docker run -e APP_COLOR=green simple-app - 6How do you make a change in docker ubuntu so that it sleeps as soon as it starts without docker run ubuntu sleep 5Make your own image as follows:
FROM Ubuntu
CMD sleep 5 - 7How to write CMD sleep 5 in JSON formatCMD ["sleep", "5"]
- 8Change the following command docker run ubuntu-sleep 10 so that when writing docker run 10 it will executeAdd the following to Dockerfile
ENTRYPOINT ["sleep"] - 9Change the following command docker run ubuntu-sleep sleep and 10 is added automaticallyAdd the following to Dockerfile
ENTRYPOINT ["sleep"]
CMD ["5"] - 10How to override entrypoint in dockerfiledocker run --entrypoint "somecommand"
Informationen
- Beschreibung
- Easy Kodekloud Docker basics Karteikarten am 4 Docker image, erstellt von Archimed Nemes am 22/12/2022.
- Erstellt von
- Archimed Nemes
- Aufrufe
- 1
- Bewertung