Skip to content

Not able to mount file (e.g. wp-config.php) #135

@ailic

Description

@ailic

#84 (comment) (by @pierreozoux)

@ailic you should open an other issue.
In your specific case, if wp-config.php is not created before starting, docker (in previous version, it is no longer the case) would create a folder, and not a file. (Now, with latest version, you'll just get an error).

The problem occurs when trying to mount the file, in this case wp-config.php. Just mounting folders works without problems.

Here's the content of docker-compose.yml file:

version: '2'
services:
  web:
    image: wordpress
    ports:
      - "80:80"
    volumes:
      - ./src/wordpress/wp-content:/var/www/html/wp-content
      - ./src/wordpress/wp-config.php:/var/www/html/wp-config.php
    environment:
      WORDPRESS_DB_NAME: db_name
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_PASSWORD: db_pass
    links:
      - db:mysql
  db:
    image: mysql
    ports:
      - "3306:3306"
    volumes:
      - mysql-data:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: db_pass
volumes:
  mysql-data:
    external: true

If wp-config.php file is previously created, command docker-compose up will fire the error:

WordPress not found in /var/www/html - copying now...
WARNING: /var/www/html is not empty - press Ctrl+C now if this is an error!
+ ls -A
wp-config.php
+ sleep 10
Complete! WordPress has been successfully copied to /var/www/html
sed: cannot rename ./sedgnRHlX: Device or resource busy

If not previously created (wp-config.php), error would be:

sed: couldn't edit wp-config.php: not a regular file

and folder with that name would be created.

Environment:

Docker version 1.10.3, build 20f81dd
docker-compose version 1.6.2, build 4d72027

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions