# When use multiple images the second one commands isn't accessible

**URL:** <https://discuss.circleci.com/t/when-use-multiple-images-the-second-one-commands-isnt-accessible/38769>\
**Category:** CircleCI Images\
**Tags:** gradle, open-jdk, java-11\
**Created:** [January 13, 2021, 12:07am UTC](https://discuss.circleci.com/t/when-use-multiple-images-the-second-one-commands-isnt-accessible/38769 "2021-01-13T00:07:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![felipeespitalher](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/felipeespitalher/32/22627_2.png) [@felipeespitalher](https://discuss.circleci.com/u/felipeespitalher)\
**Post date:** [January 13, 2021, 12:07am UTC](https://discuss.circleci.com/t/when-use-multiple-images-the-second-one-commands-isnt-accessible/38769/1 "2021-01-13T00:07:34Z")

</div>

I have this yml:

```
 jobs:
     deploy_to_staging:
         docker:
           - image: google / cloud-sdk
           - image: circleci / openjdk: 11-jdk

```

I have access to commands only from the first image, for example when the command `gradle build` runs it returns:

```
 / bin / bash: gradle: command not found

```

If I invert image order then I can access gradle commands but gcloud will not be found.

Does anyone know which is my mistake?

---

<div class="post-metadata">

**Author:** ![punkdata](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/punkdata/32/25224_2.png) [@punkdata](https://discuss.circleci.com/u/punkdata)\
**Post date:** [January 13, 2021, 5:12pm UTC](https://discuss.circleci.com/t/when-use-multiple-images-the-second-one-commands-isnt-accessible/38769/2 "2021-01-13T17:12:23Z")

</div>

@felipeespitalher a similar situation has been [addressed in this previous post](https://discuss.circleci.com/t/please-explain-multiple-images-in-an-executor/36572/2)

I would install the `gcloud` client in the `circleci/openjdk:11-jdk` image in the pipeline and eliminate the `google/cloud-sdk` image. Below is an example of how to do this:

```auto
curl -o gcp-cli.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz
tar -xzvf gcp-cli.tar.gz
echo ${GOOGLE_CLOUD_KEYS} | base64 --decode --ignore-garbage > ${HOME}/.ssh/cicd_demo_gcp_creds.json
./google-cloud-sdk/install.sh --quiet
echo 'export PATH=$PATH:~/google-cloud-sdk/bin' >> $BASH_ENV
source $BASH_ENV
gcloud auth activate-service-account --key-file ${HOME}/.ssh/cicd_demo_gcp_creds.json

```

You could also use the [gcloud CirlcleCI orbs to install](https://circleci.com/developer/orbs/orb/circleci/gcp-cli#commands-install) the client as well.

---

<div class="post-metadata">

**Author:** ![mashuDuek1](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/mashuduek1/32/28228_2.png) [@mashuDuek1](https://discuss.circleci.com/u/mashuDuek1)\
**Post date:** [July 1, 2021, 8:41pm UTC](https://discuss.circleci.com/t/when-use-multiple-images-the-second-one-commands-isnt-accessible/38769/3 "2021-07-01T20:41:32Z")

</div>

Anybody other suggestions here? I’m also running into the same issue. I don’t have access to commands from images that are no in the first listed image.

Here is my executor:

```auto
  node-pg-cypress-executor:
    docker:
      - image: cypress/base:12
      - image: cimg/node:15.11.0
      - image: circleci/postgres:9.6.2-alpine

```

I’ve removed the `environment` keys from all images.

When cypress does not come first I fail with missing cypress-specific sub-dependencies.  
When node does not come first I fail on not having `sudo` installed, which is being used by one of the commands.

Any help is super appreciated.

---

<div class="post-metadata">

**Author:** ![FelicianoTech](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/felicianotech/32/21348_2.png) [@FelicianoTech](https://discuss.circleci.com/u/FelicianoTech)\
**Post date:** [September 28, 2021, 2:34pm UTC](https://discuss.circleci.com/t/when-use-multiple-images-the-second-one-commands-isnt-accessible/38769/4 "2021-09-28T14:34:19Z")

</div>

The first image is your execution image. All commands run there. The other images are only available via TCP/IP networking.

---

<div class="post-metadata">

**Author:** ![mashuDuek1](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/mashuduek1/32/28228_2.png) [@mashuDuek1](https://discuss.circleci.com/u/mashuDuek1)\
**Post date:** [September 28, 2021, 5:43pm UTC](https://discuss.circleci.com/t/when-use-multiple-images-the-second-one-commands-isnt-accessible/38769/5 "2021-09-28T17:43:55Z")

</div>

Thank you @FelicianoTech! 🙌 I did get it to work and your explanation makes sense as to why it works as is now 🙂
