g000m
g000m

Reputation: 145

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?

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:

Upvotes: 1

Views: 1974

Answers (1)

Harlan Wilton
Harlan Wilton

Reputation: 504

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).

Upvotes: 2

Related Questions