Hi,
I’ve been reading through doco and posts regarding persistent storage for addons. In here, it says under the “map” option that /data is always available and writable.
I am testing a new addon locally (not via repository) using huginn/huginn and when exec’ed into the container, I cannot read or write into the data folder getting permission denied. I am not using any “map” option since this is on by default.
I’ve tested mappings to different folders, runtime sym links and who knows what else. But I am not getting past this.
What am I missing or what am I doing wrong? Thanks in advance.
FROM huginn/huginn
# Add any additional dependencies or scripts here if needed
COPY run.sh /usr/bin/run.sh
RUN chmod +x /usr/bin/run.sh
CMD [ "/usr/bin/run.sh" ]
I have not added anything extra at the moment. I have been experimenting with some GPT suggested options to create symlinks in run.sh like this:
#!/bin/bash
# Ensure the persistent MySQL directory exists
mkdir -p /data/mysql
# Fix permissions to allow MySQL access
chown -R mysql:mysql /data/mysql
chmod -R 775 /data/mysql
# Symlink the persistent directory to MySQL's data directory
if [ ! -L /var/lib/mysql ]; then
rm -rf /var/lib/mysql
ln -s /data/mysql /var/lib/mysql
fi
# Initialize MySQL data directory if not already initialized
if [ ! -f /data/mysql/ibdata1 ]; then
echo "Initializing MySQL data directory..."
mysql_install_db --user=mysql --datadir=/data/mysql
fi
# Start MySQL service
service mysql start
# Start Huginn
bundle exec rake db:create db:migrate
rails server -b 0.0.0.0 -p 3000
But this is GPT adding stuff which is also not needed like MYSQL as it is included. This is just an example I was given when experimenting.