Product
Pricing
Resources
Docs
Product
Pricing
Resources
Docs

Step 2 - Wrap Script in Docker

In order to get the script working with a docker image, we need to supply some additional information.

We need a requirements.xml file with the following:

git+https://bitbucket.org/uleska/uleska-custom-tools-formatter.git@master requests==2.22.0
 
Plain Text
 


The file has a command to download the Uleska library from Bitbucket, and the requests directory.

Finally, our Dockerfile includes the following:

FROM alpine:3.10.2
RUN apk add python3
RUN apk add curl
RUN apk add git
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
RUN python3 get-pip.py
RUN pip install --upgrade pip

 

COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt

 

COPY https_redirect_checker.py /usr/src/app/
 
Docker
 


To build the docker image, we need to give provide the following:

docker build -t https_redirect_checker:v1 . --no-cache
 
Bash
 


Now that you have your docker file, test that you have the system set up.

docker run https_redirect_checker:v1 python3 /usr/src/app/https_redirect_checker.py
 
Bash
 


One more thing you should include is a PNG to allow Uleska to show the logo or some other graphical representation of the tool in the UI.

To prepare our custom tool we need to put all of this information into a directory so we can easily locate and then upload it to Uleska. You should zip the Script and Requirements in preparation for the next step.