I installed Nifi image docker in a VM Ubuntu. I've tried to get one xml file using GetFile processor, however when I set up the Input Directory field with specific directory created in the Ubuntu returns a error message like this:
Input Directory validated against '/home/john/nifi/inputs' is invalid because Directory does not exist
Is correct type path like this /home/john/nifi/inputs or between ${absolute path}?
Thank very much
Enter to the Docker container with "docker exec -it <name_container> /bin/bash"
Then "cd ~" to go to the your the nifi home folder: /home/nifi
So, you are set. Create the folder input with mkdir
Related
I am a newbie in Docker. I introduced the Docker environment in WSL2 (Windows10Home). I do not wish to use the VSCode for simpler implementation. I would like to rather use the Ubuntu terminal. When I try to compile my LaTeX file (my_input.tex) with a Docker image (https://hub.docker.com/r/weichuntsai/texlive-small), but it complains that there is no such a tex file.
docker run --name mylatex -dt -v /home/myname:/home weichuntsai/texlive-small:1.1.0
When I send the following command in the terminal, he complains of no corresponding file.
txrun my_input.tex xelex, although I created this tex file in the home
(~, or home/myname) directory.
Sending ls returns tex.mf only without showing my_input.tex unfortunately.
Sending pwd returns root with some reasons. I have no idea why it returns root, not home/myname.
It may be due to my insufficient understanding of Docker, but I appreciate your kind advice on
that question.
N.B. I became to know that Docker images are located in /var/lib/docker.
To change this directory, one must stop the Docker daemon with
sudo service docker stop. Then one must edit /etc/docker/daemon.json.
{
"data-root": "/to/some/path"
}
Checking Dockerfile of your image shows that working directory is root https://hub.docker.com/r/weichuntsai/texlive-small/dockerfile
Just mount your home to container root:
docker run --name mylatex -dt -v /home/myname:/root weichuntsai/texlive-small:1.1.0
OR inside container change to home by cd /home
Checking Dockerfile of your image shows that working directory is root https://hub.docker.com/r/weichuntsai/texlive-small/dockerfile
Just mount your home to container root:
docker run --name mylatex -dt -v "/home/me":"/file" weichuntsai/texlive-small:1.1.0
OR inside container change to home by cd /home
and then you access your file like
docker exec -it mylatex bash
cd /file
ls
I am trying to start a VGS satellite container as mentioned here
But I also need to pass a environment variable SATELLITE_ROUTES_PATH, which is also a filepath in local data folder.
docker run --rm -v data:/data -p 8089:8089 -p 9098:9098 -p 9099:9099 -e SATELLITE_ROUTES_PATH=/data/httbin.yml verygood/satellite
Usage: app.py [OPTIONS]
Try 'app.py --help' for help.
Error: Invalid value for '--routes-path': File '/data/httbin.yml' does not exist.
How to resolve this issue, where I want to pass a VGS file while running container?
When you bind a volume using docker, the host directory path cannot be relative:
This won't work:
-v data:/data
Change to a absolute path like -v ~/Downloads/data:/data or -v /home/user/Downloads/data:/data
If still you see the same error, make sure the file httbin.yml exists in out data folder
Note: The -v flag is very flexible. It can bindmount or name a volume with just a slight adjustment in syntax. If the first argument begins with a / or ~/, you’re creating a bindmount. Remove that, and you’re naming the volume.
-v /path:/path/in/container mounts the host directory, /path at the
/path/in/container
-v path:/path/in/container creates a volume named path with no relationship to the host.
I have created a docker image which contains the following CMD:
CMD ["sh", "start.sh"]
When I run the docker image I use the following command inside a Makefile
docker run --rm -v ${PWD}:/selenium $(DOCKER_IMAGE)
which copies the files from the current (host-)directory to the docker's /selenium folder. The files include files for selenium tests, as well as the file start.sh. But after the container has started, I get immediately the error
"sh: 0: Can't open start.sh"
Maybe the host volume is mounted inside docker after the command has been run? Anything else that can explain this error, and how to fix it?
Maybe there is a way to run more than one command inside docker to see whats going on? Like
CMD ["ls", ";", "pwd", ";", "sh", "start.sh"]
Update
when I use the following command i the Dockerfile
CMD ["ls"]
I get the error
ls: cannot open directory '.': Permission denied
Extra information
Docker version 1.12.6
Entrypoint: WORKDIR /work
Your mounting your volume to the /selenium folder in your container. Therefor the start.sh file isn't going to be in your working directory its going to be in /selenium. You want to mount your volume to a selenium folder inside your working directory then make sure the command references this new path.
If you use docker-compose the YAML-file to run the container would look something like this:
version: '3'
services:
start:
image: ${DOCKER_IMAGE}
command: sh selenium/start.sh
volumes:
- .:/work/selenium
If you try and perform each step manually, using docker run with bash,
docker exec -it (container name) /bin/bash
It will be more easier and quicker to look at the errors, and you can change the permissions, view where the file is located, before running the .sh file and try again.
Check the permission using ls -l.
Give the permission 777 using sudo chmod 777 file_name.
Repeat for other files you might find.
I am very new to docker, and I need help to dockerize a ruby script that takes a a input directory and output directory.
i.e generate_rr_pair.rb BuildRR -n /data/ -o /output
What the script does, is it will take the -n option (input) and check if the directory exists, if it does it uses the files inside as input. The script will then output data to the -o option (output). If the output directory doesn't exist, the script will create the directory and output files there.
How can I create a Dockerfile to handle this? Should I pass these in, as environment variables? Or should I use mounted Volumes? But since the script handles fileIO, I am not sure if I want volumes. The input directory should already exist on the host, and the output directory will get created. Both directories, should remain after docker container stops.
Use the official ruby image in your docker file:
FROM ruby:2.1-onbuild
CMD ["ruby", "generate_rr_pair.rb"]
Building the container as normal
docker build -t myruby .
Which can then be run as follows:
docker run --rm -it -v /data:/data -v /output:/output myruby BuildRR -n /data -o /output
Note that volume mappings are required if you want the ruby script within the container to operate on directories mounted on the host machine.
I have installed Flume for the first time. I am using hadoop-1.2.1 and flume 1.6.0
I tried setting up a flume agent by following this guide.
I executed this command : $ bin/flume-ng agent -n $agent_name -c conf -f conf/flume-conf.properties.template
It says log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: ./logs/flume.log (No such file or directory)
Isn't the flume.log file generated automatically? If not, how can I rectify this error ?
Try this:
mkdir ./logs
sudo chown `whoami` ./logs
bin/flume-ng agent -n $agent_name -c conf -f conf/flume-conf.properties.template
The first line creates the logs directory in the current directory if it does not already exist. The second one sets the owner of that directory to the current user (you) so that flume-ng running as your user can write to it.
Finally, please note that this is not the recommended way to run Flume, just a quick hack to try it.
You are getting this error probably because you are running command directly on console, you've to first go to the bin in flume and try running your command there over console.
As #Botond says, you need to set the right permissions.
However, if you run Flume within a program, like supervisor or with a custom script, you might want to change the default path, as it's relative to the launcher.
This path is defined in your /path/to/apache-flume-1.6.0-bin/conf/log4j.properties. There you can change the line
flume.log.dir=./logs
to use an absolute path that you would like to use - you still need the right permissions, though.