i have created a task-management-compose.yml in which I added
version: '3.1'
services:
db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: 123456
ports:
- 5432:5432
adminer:
image: adminer
restart: always
ports:
- 8888:8080
# rabbitmq:
# image: rabbitmq:3-management
# ports:
# - "15672:15672"
# - "5672:5672"
after then I open command line and type docker-compose -f task-management-compose.yml up -d its work fine
but when I type localhost:8888 it shows nothing
Related
I want to use the adminer image that is raised with the following docker command:
docker run \
--rm
-p 8000:80
-e MEMORY=512M
-e UPLOAD=4096M
dockette/adminer:full
My docker-compose.yml is as follows:
version: '2.4'
services:
mariadb:
container_name: mariadb-prueba
image: mariadb
restart: always
volumes:
- ./mariadb-data:/var/lib/mysql
environment:
MYSQL_DATABASE: 'db_prueba'
MYSQL_USER: 'admin'
MYSQL_PASSWORD: 'admin'
MARIADB_ROOT_PASSWORD: 'admin'
ports:
- 2000:3306
adminer:
container_name: adminerprueba
image: dockette/adminer
restart: always
ports:
- 8000:80
environment:
- UPLOAD=4096M
- MEMORY=512M
volumes:
mariadb-data:
The problem is that it runs but when I do localhost:8000 the system appears to be down.
Am I missing something in the docker-compose
I am using Docker 20.10.7 on Mac OS and docker-compose to run multiple docker containers.
When I start it for the first time, all the docker images are properly labeled and appear as the following.
However, after subsequent runs (docker-compose up, docker-compose down), suddenly all the image names are changed to sha256 and start to look like this
Please advise how to avoid this behavior. Thank you.
UPDATE #1
This is the docker-compose file I use to start containers.
Initially the old displayed with properly labeled image names.
However, not even if I run a docker system prune command it continues to label them as sha256:...
version: '3.8'
services:
influxdb:
image: influxdb:1.8
container_name: influxdb
ports:
- "8083:8083"
- "8086:8086"
- "8090:8090"
- "2003:2003"
env_file:
- 'env.influxdb.properties'
volumes:
- /Users/user1/Docker/influxdb/data:/var/lib/influxdb
restart: unless-stopped
telegraf:
image: telegraf:latest
container_name: telegraf
links:
- db
volumes:
- ./telegraf.conf:/etc/telegraf/telegraf.conf:ro
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3000:3000"
env_file:
- 'env.grafana.properties'
links:
- influxdb
volumes:
- /Users/user1/Docker/grafana/data:/var/lib/grafana
restart: unless-stopped
db:
image: mysql
container_name: db-container
command: --default-authentication-plugin=mysql_native_password
ports:
- '3306:3306'
environment:
MYSQL_ROOT_PASSWORD: P#ssw0rd
MYSQL_USER: root
MYSQL_PASSWORD: P#ssw0rd
MYSQL_DATABASE: db1
volumes:
- /Users/user1/Docker/mysql/data:/var/lib/mysql
- "../sql/schema.sql:/docker-entrypoint-initdb.d/1.sql"
healthcheck:
test: "/usr/bin/mysql --user=root --password=P#ssw0rd --execute \"SHOW DATABASES;\""
interval: 2s
timeout: 20s
retries: 10
restart: always
adminer:
image: adminer
container_name: adminer
restart: always
ports:
- 8081:8080
redis:
image: bitnami/redis
container_name: redis
environment:
- ALLOW_EMPTY_PASSWORD=yes
#- REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL
ports:
- '6379:6379'
volumes:
- '/Users/user1/Docker/redis/data:/bitnami/redis/data'
- ./redis.conf:/opt/bitnami/redis/mounted-etc/redis.conf
I was trying to create a PHP development environment with PHP, MariaDB, and a tutorial suggested to use Adminer for database management. So I generate my docker-compose.yml file like this:
version : '3.1'
services:
php:
build:
context: .
dockerfile: Dockerfile
ports:
- 80:80
volumes:
- ./src:/var/www/html/
db:
image: mariadb
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
volumes:
- ./mariadb-data:/var/lib/mysql
adminer:
image: adminer
environment:
ADMINER_DEFAULT_SERVER: db
restart: always
ports:
- 8080:8080
But when I set the volumes for MariaDB, I got an error in the Adminer login page. When I don't set them it seems to work well.
version : '3.1'
services:
php:
build:
context: .
dockerfile: Dockerfile
ports:
- 80:80
volumes:
- ./src:/var/www/html/
db:
image: mariadb
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
volumes:
- ./mariadb-data:/var/lib/mysql
adminer:
image: adminer
environment:
ADMINER_DEFAULT_SERVER: db
restart: always
ports:
- 8080:8080
links:
- php
- db
I'm trying to setup a docker to run mysql Mosquitto and node red but keep getting the unsupported config option errors..
Services:
mysql:
image: mysql
container_name: mysql
restart: always
ports:
- “6603:3306”
Environment:
MYSQL_ROOT_PASSWORD: “abcd1234”
volumes:
- mysql-data
node-red:
image: nodered/node-red:latest
restart: always
container_name: nodered
environment:
-TZ=Europe/London
depends_on:
- mysql
ports:
- “1880:1880”
links:
- mysql:mysql
- mosquitto:mosquitto
volumes:
- node-red-data
mosquitto:
image: eclipse-mosquitto
hostname: mosquitto
container_name: mosquitto
restart: always
ports:
- "1883:1883"
volumes:
mysql-data:
node-red-data:
Any thoughts on why im getting these errors?
Unsupported config option for Services: 'mosquitto'
Unsupported config option for volumes: 'mysql-data'
I am trying to up phpserver via docker-compose.
I put 3 files in my working directory.
.env
docker-compose.yml
Dockerfile
.env
##PATHS
DB_PATH_HOST=./databases
APP_PATH_HOST=./blog
APP_PATH_CONTAINER=/var/www/html/
MYSQL_ROOT_PASSWORD=123456
docker-compose.yml
version: '3'
services:
web:
build: .
environment:
- APACHE_RUN_USER=www-data
volumes:
- ${APP_PATH_HOST}: ${APP_PATH_CONTAINER}
ports:
- 8080:80
working_dir:
- ${APP_PATH_CONTAINER}
db:
image: mariadb
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
volumes:
- ${DB_PATH_HOST}: /var/lib/mysql
adminer:
image: adminer
restart: always
ports:
- 6080:8080
composer:
image: composer:1.7
volumes:
- ${APP_PATH_HOST}: ${APP_PATH_CONTAINER}
working_dir: ${APP_PATH_CONTAINER}
command: composer install
and Dockerfile
FROM php:7.2-apache
RUN docker-php-ext-install \
pdo_mysql \
&& a2enmod
rewrite
But after I try to run
docker-compose up --build
I have the problem
ERROR: The Compose file '.\docker-compose.yml' is invalid because:
services.web.working_dir contains an invalid type, it should be a string
services.composer.volumes contains an invalid type, it should be a string
services.web.volumes contains an invalid type, it should be a string
services.db.volumes contains an invalid type, it should be a string
I tried to change docker-compose file version to 2 - does not work
I tried to use '' and "" the same problem.
I want to run my server successfully.
The following two formats work:
Format #1
environment:
MYSQL_ROOT_PASSWORD: rootpassword
Format #2
environment:
- MYSQL_ROOT_PASSWORD=rootpassword
version: "3.3"
services:
web:
build: .
environment:
- APACHE_RUN_USER=www-data
volumes:
- "${APP_PATH_HOST}: ${APP_PATH_CONTAINER}"
ports:
- 8080:80
working_dir: ${APP_PATH_CONTAINER}
db:
image: mariadb
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
volumes:
- "${DB_PATH_HOST}:/var/lib/mysql"
adminer:
image: adminer
restart: always
ports:
- 6080:8080
composer:
image: composer:1.7
volumes:
- "${APP_PATH_HOST}: ${APP_PATH_CONTAINER}"
working_dir: ${APP_PATH_CONTAINER}
command: composer install
What you used for working_dir was a list. It needed a string.
I want to connect to from adminer to postgres
version: '3'
services:
web:
build: .
environment:
- APACHE_RUN_USER=www-data
volumes:
- ./blog:/var/www/html/
ports:
- 8080:80
working_dir: /var/www/html/
db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: kisphp
POSTGRES_USER: root
POSTGRES_DB: kisphp
ports:
- "5432:5432"
volumes:
- ./postgres:/var/lib/postgresql/data
adminer:
image: adminer
restart: always
ports:
- "6080:8080"
and I have next error.
SQLSTATE[08006] [7] FATAL: password authentication failed for user "root"