简体   繁体   中英

update to php7.2 in docker wp-cli container

I'm new to docker. I have a WordPress stack for local dev that implements wp-cli via a different container. The WP container has PHP 7.2.4, but the wp-cli container appears to have php 5.6.27.

What's the best approach to updating php for wp-cli?

  • remove wp-cli container, install wp-cli, save as a new container
  • use a different container for wp-cli
  • update php inside the existing container
  • ?

snippets from my docker-compose file:

wordpress:
    container_name: wordpress
    depends_on:
      - db
    image: jburger/wordpress-xdebug
    volumes:
      - "./public:/var/www/html"

 wpcli:
    command: "--info"
    container_name: wpcli
    entrypoint: wp
    image: tatemz/wp-cli
    links:
      - db:mysql
    volumes:

You're pulling in an image which hasn't been freshly built/pushed in a year.

The DockerFile itself of these images is exactly what you need. If you clone the original repo into a folder, set the build param in your docker-compose file to that folder, and then run docker-compose build , you'll have a fresh image.

The ideal setup is to actually have a 'workspace' container, which contains all of the tools needed to interact with your project, for a reference of what that looks like, see laradock (it can be a bit overwhelming).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM