How to Keep the Conjur CLI Persistent

If you would like to keep the Conjur CLI persistent you can use this command. This command just sets the entry point of the container to sleep for infinity. This makes it so the process never stops, instead of the entry point being the CLI and the container exiting when there’s no command.

docker run --name conjures-cli -d --entrypoint sleep cyberark/conjur-cli:5-latest infinity

Fill in the details, according to your Conjur configuration.

An easier way to make sure the process never stops is to put this setup right into your docker-compose file. Here is an example of this:

version: '2'
services:
  database:
    image: postgres:9.3

  conjur:
    image: cyberark/conjur
    command: server
    environment:
      DATABASE_URL: postgres://postgres@database/postgres
      CONJUR_DATA_KEY:
    depends_on: [ database ]
    ports:
      - "8080:80"

  client:
    image: conjurinc/cli5
    depends_on: [ conjur ]
    entrypoint: sleep
    command: infinity
    environment:
      CONJUR_APPLIANCE_URL: http://conjur
      CONJUR_ACCOUNT:
      CONJUR_AUTHN_API_KEY:
      CONJUR_AUTHN_LOGIN: admin

Notice the entry point: sleep and the command: infinity lines. Those will do the same thing as the command above, without having to type it in every time.

1 Like