Hi all, I have obtained an enterprise pactflow doc...
# pactflow
p
Hi all, I have obtained an enterprise pactflow docker image as well as a license file. In the below pactflow doc, https://docs.pactflow.io/docs/on-premises/license/ There is a way to create a new image with the license file baked in it. I am not able to understand the steps shown in that section. (As shown in screenshot) So far what I have done : 1. Pulled Enterprise docker image using robot credentials. 2. Have put my license file in a directory. (C:\PactFlow) I want to know what command I need to run to create a new image with license file baked in it.
t
The first section there is the contents of the
Dockerfile
Create a Dockerfile with that content, then run the docker build command listed on your screenshot, in the directory with the Dockerfile
1
You may need to update the path to your license file that is listed in your Dockerfile.
👀 1
p
ARG ONPREM_IMAGE FROM ${ONPREM_IMAGE} COPY --chown=app:app pactflow-onprem.lic *C:/PactFlow/*pactflow-onprem.lic My license path : C:/PactFlow Is this the only thing I need to change in my Dockerfile for path (see highlighted part) ?
t
I don't think that's right. The syntax for the copy command is source -> destination.
I'm not a pactflow person (and I don't use docker very much), I'm just interpreting the docs for you.
p
I am assuming here that I need to put a path in place of ONPREM_IMAGE. Just not sure what I need to put. 1. I know where my license file exists in my local. 2. I don't know the location of enterprise docker image in my local. It is present in the docker desktop
t
Pretty sure that’s the docker image ID/tag, not a path. Check the docker documentation
m
Hi Prakhar, may I ask, what runtime are you planning on deploying to?
p
Pivotal Kubernetes Service (PKS)
m
Could you link the license at runtime as a volume mount? Then you don't need to create a new pipeline to build the image, publish it to a registry etc
👀 1
p
@Matt (pactflow.io / pact-js / pact-go) Thanks for your suggestion. Also, Sorry for the late response, I am new to Kubernetes. I created a yaml script for deployment. For volume mount, in my yaml file I am putting in the name and path. But I am not sure what to put there in path for this. (See screenshot below) Can you suggest what to put there OR another way? What I have done so far : I am able to deploy my image (without license file) to PKS where its asking for a license file.
This message contains interactive elements.
m
Best talking to somebody in your team that knows Prakhar
You could also embed the binary contents this way:
Copy code
kubectl create configmap pactflow-license --from-file pactflow.lic
then
Copy code
apiVersion: v1
kind: ConfigMap
metadata:
 name: pactflow-license
 namespace: pactflow
binaryData:
 pactflow.lic: >- eAAAAE9GdbRGFS/CRDnABtJx...TRUNCATED...IGFueSBlZGl0b3Iu
then I add this to the deployment
Copy code
spec:
     containers:
     - image: <http://quay.io/pactflow/enterprise:1.11.1|quay.io/pactflow/enterprise:1.11.1> # note, set version here
       name: pactflow
       resources: {}
       volumeMounts:
       - name: config-volume
         mountPath: /home/pactflow-onprem.lic
         subPath: pactflow.lic
     volumes:
       - name: config-volume
         secret:
           secretName: pactflow-license
Again, if that doesn’t make sense, I recommend you work with somebody at your company that does understand it.
👀 1
👍 1
p
Copy code
kubectl create configmap pactflow-license --from-file pactflow.lic
On running the above command, I am not getting any data inside my Config-map. (See Screenshot below) Also, after deploying my image onto PKS using deployment script, I am getting the error saying : "Protected script /home/pact_broker_fork/lib/pact_broker/version.rb checksum error. The file has been modified. If this script requires a license file in order to run, this error may be caused by an invalid license file. Install the original unmodified file or contact the author of the script to get the original file or license file." I checked with the Kubernetes team on this, they are unable to figure out why we have no data coming up from license file. Everything in the script looks good to them, but they are not sure how we can read from the license file.
We experimented with a plain text file with data and ran commands to create the config map. There we could see the data. Hence, we changed the extension of license file to txt to experiment if the license file data comes into the config map or not. Even then we are not able to see the data in the config map.
m
I can't help much more here, sorry, they are the two main options that I know work, so it's probably something about how it's expected or your environment. Maybe go back to baking the license file in
p
The pactflow documentation was a little unclear to me on the steps to perform. All I did was : Create a Dockerfile with the content in section 1. But what all we need to modify in that file, and what args to put in docker build command, need help on that. Can you explain what am I missing here? Simply copy pasting that content in the dockerfile does not work when I run the docker build command.
t
You’re going to need help from someone familiar with the docker syntax (this is why I linked you to the documentation)
Someone familiar with the docker syntax should be able to read and understand the instructions there - for example,
ONPREM_IMAGE
is clearly something you'll have to provide yourself
1
(I'm not a pactflow person, and I barely ever use docker, so I'm not the best person to help - but I would guess there's someone in your organisation that understands the docker commands. If there isn't, you can become one by reading the documentation for the Dockerfile syntax that I linked earlier)
🙏 1