how to add PDO mysql driver in Processmaker 4 PHP executor - processmaker

I need to connect to a mysql database from a processmaker script task. I tried using PDO but I get an error that cant find mysql driver.
I have tried modifying the executor configuration by adding:
RUN apt-get install -y php7.2-mysql
RUN apt-get install -y php-mysql
RUN apt-get install -y php7-mysql
But none of the above work. During the build proces I get a message that can not find these packages. How should I go about adding the PDO mysql driver so that I can open connections to mysql databases in my PHP scripts?

I figured out how to include the mysql support to the processmaker 4 PHP executor.
You can either modify the existing PHP executor or create a new php executor and add the following line to the dockerfile using the Processmaker interface
RUN docker-php-ext-install pdo pdo_mysql
After adding this, save and rebuild the executor . Now when I run the code I no longer get the error message stating that the driver can not be found.

Related

Running PHP scripts on Synology from within Docker container

Today I had to move my Domoticz/jadahl/Synology setup to one that runs in a Docker container. While this didn’t give any problems, I have one issue. Domoticz allows scripts to be executed when a switch is toggled. I have been running PHP scripts for years this way and I was wondering if it is possible to run a script located on the Synology from the Docker container. Totally new to Docker so forgive any stupid questions.
If not, any tips on how to approach this so I can get back to my dayjob?
Solved this by creating my own image:
FROM domoticz/domoticz:latest
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install etherwake wget curl php-cli php-xml php-soap -y

dockerized conan shows FileExistsError: [Errno 17] File exists: './util-linux-2.33.1/tests/expected/libmount/context-X-mount.mkdir'

The full error is
ERROR: libmount/2.33.1: Error in source() method, line 26
tools.get(**self.conan_data["sources"][self.version])
FileExistsError: [Errno 17] File exists: './util-linux-2.33.1/tests/expected/libmount/context-X-mount.mkdir'
My setup is a dockerized conen where the container is built like this:
FROM gcc:10.2.0
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get -y upgrade
RUN apt-get install -y cmake
RUN apt-get install -y python3-pip
RUN pip3 install --upgrade pip
RUN pip3 install conan
RUN conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
CMD ["/bin/bash"]
My basepath contains the folders build/conan and there is a conanfile.txt in the basepath.
The conanfile.txt contains:
[requires]
sdl2/2.0.12#bincrafters/stable
The motivation to dockerize is so that I get to a stable buid environment over all my machines.
build/conan is extracted to store all cached files between builds, or so I hope it will once this works.
I made this into a repository so you can check out this example
EDIT: I modified the repo as I went on investigating - the original is in the commit history.
https://github.com/Aypahyo/dockerized-conan-shows-fileexistserror-errno-17-file-exists-util-linux-2.git
What I want is to use conan install from within a container on a mounted docker container with caching on the host machine.
My obvious question is: What is happening here and how do I fix it?
The issue seems to be stemming from the volume mount on my system.
I followed user uilianries advice and went for building a container based on an official conan-docker-tools container as well as moving the volume into a docker managed volume.
This error message is gone now although it looks like this approach in general may not fit what I want to do.
I modified the repository for this question with what I ended up with. https://github.com/Aypahyo/dockerized-conan-shows-fileexistserror-errno-17-file-exists-util-linux-2
caching does not work as I want it to but that is not what this question was about.

How can I edit tomcat configuration files inside the docker container?

I am trying to nano/vim inside a docker container to edit the tomcat config files but i am getting an error that nano/vim is unknown command. I tried to yum install, still yum is unknown comand. How do I go about it
The most common editor is vi. To install some packages into your container you have to know it's base image. Most of distros create a special file in /etc/ with all necessary information: something-release, you can find it out with this command:
cat /etc/*release
And then use the package manager of current distro.
for Alpine it will be apk update && apk add vim.
for Ubuntu/Debian - apt update && apt install vim.
for Centos/RedHat/Fedora - yum install vim
etc

Executing scripts under /docker-entrypoint-initdb.d with root permission

I want to execute a script along with initialising the DB schema when I spawn the mariadb image.
I've placed these files under /docker-entrypoint-initdb.d
The schema initialisation is working as expected
The shell script contains apt-get install instructions, which results with the below error
Unable to lock the administration directory (/var/lib/dpkg/), are you
root?
Performing a whoami within the script gave me the output as mysql, which explains the script is being run as the user 'mysql' and not as 'root'.
Is there any way I can run this script as root ?
If you do it in a Dockerfile:
FROM mariadb
RUN apt-get update && apt-get install -y vim

Docker usage with Odoo 10.0

I need to know how to setup a Docker to implement a container that could help me run an Odoo 10.0 ERP environment in it.
I'm looking for references or some setup guides, even I don't mind if you can paste the CLI below. I'm currently developing in a Ubuntu OS.
Thanks in Advance.......!!!
#NaNDuzIRa This is quite simple. I suggest that when you want to learn how to do something even if you need it very fast to look into the "man page" of the tool that you are trying to use to package your application. In this case, it is Docker.
Create a file name Dockerfile or dockerfile
Now that you know the OS flavor you want to use. Include that at the beginning of the "Dockerfile"
Then, you can add how you want to install your application in the OS.
Finally, you include the installation steps of Odoo for which i have added a link at the bottom of this post.
#OS of the image, Latest Ubuntu
FROM ubuntu:latest
#Privilege raised to install the application or package as a root user
USER root
#Some packages that will be used for the installation
RUN apt update && apt -y install wget
#installing Odoo
RUN wget -O - https://nightly.odoo.com/odoo.key | apt-key add -
RUN echo "deb http://nightly.odoo.com/10.0/nightly/deb/ ./" >> /etc/apt/sources.list.d/odoo.list
RUN apt-get -y update && apt-get -y install odoo
References
Docker
Dockerfile
Odoo

Resources