• Django framework Community leader in Namibia • Co – founder of Python Namibia • Web Developer, Python and Django instructor • Organize of PyCon Namibia
packages your application and all its dependencies together in the form of a docker container to ensure that your application works in any environment. • Its opensource • Designed to make it easier to create, deploy, and run applications by using containers. • Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package.
the primary way that many Docker users interact with Docker. 2. Images - is a read-only template with instructions for creating a Docker container. 3. Docker registries - stores Docker images, run Docker pull or docker run 4. Containers - is the execution environment for Docker. Ø Containers are created from images
the Docker desktop tools found https://docs.docker.com/install/ Important: Download the correct installer for your operating system and run the installation.
-This command is used to get the currently installed version of docker docker pull - Usage: docker pull <image name> : This command is used to pull images from the docker repository(hub.docker.com) docker run - Usage: docker run -it -d <image name> - This command is used to create a container from an image docker ps -This command is used to list the running containers docker ps –a -This command is used to show all the running and exited containers docker exec - Usage: docker exec -it <container id> bash - This command is used to access the running container docker stop - Usage: docker stop <container id> - This command stops a running container docker images -This command lists all the locally stored docker images docker rm - Usage: docker rm <container id> - This command is used to delete a stopped container docker rmi - Usage: docker rmi <image-id> - This command is used to delete an image from local storage docker build - Usage: docker build <path to docker file> -This command is used to build an image from a specified docker file Source edureka
folder in local directory In called “docker” in any location of your choice e.g C drive. Step 2: Create python script and Dockerfile Create a file ”pynam2019.py paste code below Cretate a file”Dockerfile”without extension and paste code below NB!!! Save all these files in the same folder
a folder in local directory In called “docker” in any location of your choice e.g C drive. Step 2: Create python script and Dockerfile Create a file ”pynammachine.py” and paste code below Cretate a file”Dockerfile”without extension and paste code below NB!!! Save all these files in the same folder
• is a text document that contains all the commands a user could call on the command line to assemble an image 2. Docker-compose file (docker-compose.yml) • Describes the services that make your app. E.g in our case it is web server and database. • Describes which Docker images these services use, how they link together, any volumes they might need mounted inside the containers. • Finally, describes the ports these services expose. 3. Requirements file - for required software
container 2. docker-compose build • rebuild your image 3. docker-compose stop • Stop the container Describes the services that make your app. YML Config
web django-admin startproject DjangoProject . Step 2: Change the ownership of the new files. (Linux user) sudo chown -R $USER:$USER . NB.. Window user and MacOS You should already have ownership of all files, including those generated by django-admin