Placing network restrictions with docker
Is it possible using a docker instance to place restrictions on a network. i.e. certain websites being restricted when using a sandbox browser?
See also questions close to this topic
Docker windows --network=host analog
I want to run mongodb inside docker container (without installing it on host machine) and work with it locally.
For linux I do:
npm run --network=host mongo
and all works as I want. I am able to connect to mongodb which runs on
But when I do the same on Windows 10 machine, I can't connect to
localhost:27017from host machine. When I run command as above, in console I see that mongodb is running and waiting for connections. But I can't connect from windows host.
So, how to make it work?
How can I set path to load data from CSV file into PostgreSQL database in Docker container?
I would like to load data from CSV file into PostgreSQL database in Docker. I run:
docker exec -ti my project_db_1 psql -U postgres
Then I select my database:
Now I try to load data from
myfile.csvwhich is in the main directory of the Django project into
\copy backend_data (t, sth1, sth2) FROM 'myfile.csv' CSV HEADER;
However I get error:
myfile.csv: No such file or directory
It seems to me that I tried every possible path and nothing works. Any ideas how can I solve it? This is my docker-compose.yml:
version: '3' services: db: image: postgres environment: POSTGRES_USER: myuser POSTGRES_PASSWORD: mypassword django: build: . command: python3 manage.py runserver 0.0.0.0:8000 volumes: - .:/code ports: - "8000:8000" depends_on: - db
Docker, running NVM script in a new bash shell
I have the following in my Dockerfile:
run apt-get update; \ apt-get install -y curl && \ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
Following this line of code, I need to run a command in a new bash shell so that the environment variable set from the NVM script are used.
I have tired the following to install Nodejs and it does not work:
run ["/bin/bash", "-c", "nvm install 8.7.0"]
What can I do?