docker can't run scrapy-splash - javascript

I'm want to scrape dynamic content with splash and scrapy .When i follow the documentation for installation in Linux 'https://splash.readthedocs.io/en/stable/'
I am not able to run the image with command:
docker run -p 8050:8050 scrapinghub/splash
I get the followig error :
python3: can't open file '/app/bin/splash': [Errno 13] Permission denied
I don't know where to find that file to change the permissions for it .
Thank you

When you installed docker, did you add your user to docker group?
If not, add it using
usermod -aG docker <your-user-name>
and then run
docker run -it -p 8050:8050 scrapinghub/splash

Related

Why I got Permission denied inside Docker container after npx create?

This is what I have done in the first place
docker run --name=nodesetup -it --mount type=bind,source="$(pwd)",target=/usr/src/app -w /usr/src/app
node bash
Mysql2 works fine
npm i mysql2
when I go for
npx create-react-app test-client
sh: 1: create-react-app: Permission denied
I am bind mounted root#83d263a01dc7:/usr/src/app/test-app#.
How to solve this?
It's an issue with permissions on the host directory that you map. What exactly the issue is, I can't figure out. The container runs as root, so it should have access.
But if you run your container with the UID and GID of your user on the host by adding -u $(id -u):$(id -g) as an option, it works. Like this
docker run --name=nodesetup -it --mount type=bind,source="$(pwd)",target=/usr/src/app -w /usr/src/app -u $(id -u):$(id -g) node bash
This also has the advantage that the files created on the host are owned by you, making it easier to edit them, etc.

Node.js docker can't install npm dependencies

I have this Dockerfile
FROM node:14
WORKDIR /app
COPY package.json .
RUN npm install
COPY . .
EXPOSE 3000
CMD [ "node", "app.mjs" ]
And I can successfully run
docker run hello-world
on my ubuntu 20.10 OS.
So I am assuming that docker is installed successfully.
But when I tried to run
docker build .
It gives me this error
This is not something with the npm. I can locally install the dependencies without any issue. I assume Dokcer can't access npm registry to pull the npm packages. Something to do with networks I guess.
How do I fix this issue?
This is my code
https://github.com/Enuri-Information-Systems/docker-test
Depending on the network configuration it could happen that you run into problems that the container is not able to connect to a server to download data. This can have various reasons and also depends on how you run docker.
One common thing is that your network requires the usage of a proxy. But only having the error message it is not possible to tell what the exact reason in your case is.
One solution to that problem is to specify the network mode. Adding --network host as an option should most of the time work.
So running your build command that way docker build --network=host . should work.

React-Native cannot run project if I am not Sudo

I am unable to run react-native project with the code react-native run-android. I am getting the following error
info Starting JS server...
info Building and installing the app on the device (cd android && ./gradlew app:installDebug)...
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not create service of type AnnotationProcessorDetector using JavaGradleScopeServices.createAnnotationProcessorDetector().
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
error Command failed: ./gradlew app:installDebug. Run CLI with --verbose flag for more details.
But it runs if I run it as root `sudo react-native run-andoid'.
How can I make the project run without being root??
I found out from reading the post by Medium that u have to give permission to every folder explicitly when u encounter a permission issue when installing react native and realated tools, so that u can run the app without being sudo. Otherwise the files installed by sudo can only be run as sudo.
Use the below command to give access to the current user for that specific folder
sudo chown -R $(whoami) ~/Documents/Myapplicationfolder

Deploying static js and html file on web server using http-server and forever

I have a folder on ubuntu server which has a bunch of d3, js files. I want to display the html file on the browser running on the server.
I have got both node.js and http-server and forever installed.
I tried first with just http-server using nohup to run it in background.
nohup http-server -p 8000 -a 10.1.152.145 &
THis works and open up the directory structure on the browser. On clicking the html file there it opens up the visualization. I however want the html to be directly displayed on browser without havinng to click on it.
I then read forever is a better way to run a code in background on server so I did this:
forever start $(which http-server) -p 8000 -a 10.1.152.145 -d false
This doesn't give any error in bash, but when I got to
10.1.152.145:8000 on browser it doesn't display any file directory and says access denied.
Access to 10.1.152.145 was denied You don't have authorization to view this page.
HTTP ERROR 403
Any help in fixing this?
Thanks

Vue-cli project run using yarn run dev command

I am running vue cli project using command yarn run dev it compile successfully, but does not show any output on browser on localhost:8080 link, can’t establish a connection to the server at localhost:8080. error displayed.
Not any manual port set programmatically.enter image description here

Categories