I am very new to CICD DevOps tools like Jenkins, Jfrog, Docker, etc. I developed one flask application and created the following docker file to successfully build and run the docker image.
As per my project, we have some organization standard docker images that we need to use and all the images are stored in jfrog artifactory. I checked some documentation from jfrog but did not get any clear idea of how I can pull the docker image from jfrog and build my application.
Sample Docker file --
# Use the Python3.7.2 image
FROM python:3.7.2-stretch
# Set the working directory to /app
WORKDIR /flask-app
# Copy the current directory contents into the container at /app
ADD . /flask-app
# Install the dependencies
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# run the command to start gunicorn
CMD ["gunicorn" , "-b", "0.0.0.0:5000", "application:application"]
The official Documentation says what steps you need to do in order to pull or push some image:
Login to your repository use the following command with your Artifactory Cloud credentials.
docker login ${server-name}.jfrog.io
Pull an image using the following command.
docker pull ${server-name}.jfrog.io/{repo-name}/<image name>
Push an image by first tagging it and then using the push command.
docker tag <image name> ${server-name}.jfrog.io/{repo-name}/<image name>
docker push ${server-name}.jfrog.io/{repo-name}/<image name>