docker-compose

FATAL: bogus data in lock file “postmaster.pid” after repairing disk and changing the data folder location postgres docker

牧云@^-^@ 提交于 2021-01-29 16:18:53
问题 We had a problem with our hard drive which contains the data folder for postgres database we repaired that hard and move the data folder to new hard drive now when we try to start our db container we get following error. db_1 | db_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization db_1 | db_1 | FATAL: bogus data in lock file "postmaster.pid": "" I tried to remove the postmaster.pid file but then I get the following error, db_1 | PostgreSQL Database

redis connection error within docker container

旧时模样 提交于 2021-01-29 15:35:55
问题 I'm trying to setup a light-weight RQ task queue app running in Docker. I keep on getting this error: ValueError: Redis URL must specify one of the following schemes (redis://, rediss://, unix://) When grabbing from environmental variable ( os.getenv() ) it doesn't work, but somehow when hard-coding in redis://redis:6379/0 , it seems to work. However, this is not really a long-term solution in my opinion. I looked at: link1 and link2, but there wasn't really a solution, the thread went dead.

Docker-compose: connect from Docker container to linux host

北慕城南 提交于 2021-01-29 14:58:51
问题 In "naked" Docker, I can use --network=host to make the host reachable from the container through the docker0 interface at 127.0.0.1 , or I can reach the host at 172.17.0.1 . Ostensibly docker-compose supports the host networking driver through network_mode: host . Unfortunately, this prevents me from using exposed ports. Containers created using docker-compose don't live on the docker0 interface, and hence can reach the host at some IP address like 172.18.0.1 or 172.19.0.1 , decided at

How to save user uploaded files to mounted volume using PHP, docker-compose?

眉间皱痕 提交于 2021-01-29 14:50:21
问题 I have a LAMP stack configured with docker-compose, and am having issues saving user uploaded files to a mounted volume for persistent storage. Here is my compose file: version: '3.7' services: php-apache: build: './php-apache' restart: always ports: - 5000:80 volumes: - ./public_html:/var/www/html - ./composer/vendor:/var/www/html/vendor - ./tmp:/usr/local/tmp - ./cert/:/usr/local/apache2/cert - covers:/var/lib/app-data/covers:rw - ebooks:/var/lib/app-data/ebooks:rw depends_on: - mysql -

docker container json log showing INFO and WARNING statements with stderr as stream

孤者浪人 提交于 2021-01-29 14:41:58
问题 On <Container Id>-json.log finding some entries with INFO and WARNING with stream as stderr. Actually, these have to be with stream as stdout. Can anybody give a clue to where exactly I need to look into this? Is this docker related configuration or my application related configuration? Example, {"log":"[2020/02/20-08:50:26,557]-[**INFO** ]-[362]-[testlogger]--4: 202a68dfd8621ee9de1a7ff4\n","stream":"stderr","time":"2020-02-20T08:50:26.55867314Z"} 来源: https://stackoverflow.com/questions

Can't access Docker container by name in same network

荒凉一梦 提交于 2021-01-29 14:36:00
问题 I've set up a very simple socket communication using the following Java classes: Server.java : public class Server { public static void main(String[] args) throws Exception { try (ServerSocket listener = new ServerSocket(59090)) { while (true) { try (Socket socket = listener.accept()) { Scanner in = new Scanner(socket.getInputStream()); while (in.hasNextLine()) { System.out.println("UPPER CASE: " + in.nextLine().toUpperCase()); } } } } } } Client.java : public class Client { public static

Acessing ARP table of Host from Docker container

跟風遠走 提交于 2021-01-29 13:19:36
问题 How can I access the host ARP records from within a Docker container? I tried to mount a volume (in a docker-compose file) /proc/net/arp:/proc/net/arp but found out that I can't make any volume with /proc . Then I tried to mount it elsewhere like /proc/net/arp:/root/arp , but then if I cat /root/arp , from within the container, the table comes out empty. docker run -v /proc/net/arp:/root/arp alpine cat /root/arp <-- returns empty table Ideas? 回答1: You should be good if you add privileged mode

Why is this volume mounted as read only?

别说谁变了你拦得住时间么 提交于 2021-01-29 10:17:03
问题 I got from this link https://hub.docker.com/_/wordpress a docker-compose.yml file like this. version: '3.1' services: wordpress: image: wordpress restart: always ports: - 8080:80 environment: WORDPRESS_DB_HOST: db WORDPRESS_DB_USER: exampleuser WORDPRESS_DB_PASSWORD: examplepass WORDPRESS_DB_NAME: exampledb volumes: - wordpress:/var/www/html db: image: mysql:5.7 restart: always environment: MYSQL_DATABASE: exampledb MYSQL_USER: exampleuser MYSQL_PASSWORD: examplepass MYSQL_RANDOM_ROOT

Arsenic with chromedriver on ubuntu: FileNotFoundError: [Errno 2] No such file or directory: 'chromedriver'

倾然丶 夕夏残阳落幕 提交于 2021-01-29 09:55:12
问题 FileNotFoundError: [Errno 2] No such file or directory: 'chromedriver' I am using docker to build my app on ubuntu server. Dockerfile: FROM python:latest WORKDIR /src COPY requirements.txt /src RUN pip install -r requirements.txt COPY . /src docker-compose.yml : version: '3.1' services: tgbot: container_name: bot build: context: . command: python app.py restart: always environment: WEBAPP_PORT: 3001 env_file: - ".env" ports: - 8443:3001 networks: - botnet volumes: - ./:/src chrome: image:

NGINX reverse proxy not working to other docker container

风格不统一 提交于 2021-01-29 09:28:08
问题 I have a setup with two docker containers in a docker compose. Now I want to use proxy_pass feature from nginx to proxy the connection from nginx to other container. docker compose version: '3.4' services: reverse_proxy: image: nginx:alpine volumes: - ./nginx.conf:/etc/nginx/nginx.conf - ./error.log:/var/log/nginx/error.log ports: - "8081:8081" apigateway.api: image: ${REGISTRY:-configurator}/apigateway.api:${TAG:-latest} build: context: . dockerfile: src/Services/ApiGateway/ApiGateway.Api