Conjur Tutorial - Ubuntu

Hi All,

I’m trying to follow the tutorial on my Ubuntu server and had a challnage to run docker-compose at step#5:
sudo docker-compose exec conjur conjurctl account create myConjurAccount > admin_data

Hard coding the key for CONJUR_DATA_KEY resolved the issue for me.

Here is the full log of my steps.

test@ubuntu:~/conjur-quickstart$ sudo docker-compose pull
Pulling openssl  ... done
Pulling bot_app  ... done
Pulling database ... done
Pulling conjur   ... done
Pulling proxy    ... done
Pulling client   ... done

test@ubuntu:~/conjur-quickstart$ sudo docker images
REPOSITORY                       TAG                 IMAGE ID            CREATED             SIZE
cyberark/conjur-cli              5                   590f27c144c4        2 days ago          939MB
postgres                         9.4                 36726735dc3c        4 days ago          206MB
cyberark/conjur                  latest              b1ce92854a9d        3 weeks ago         638MB
nginx                            1.13.6-alpine       5c6da346e3d6        23 months ago       15.5MB
cfmanteiga/alpine-bash-curl-jq   latest              3b21d4d5b512        2 years ago         9.9MB
svagi/openssl                    latest              ff2dd4e8bf06        3 years ago         5.35MB

test@ubuntu:~/conjur-quickstart$ sudo docker-compose run --no-deps --rm conjur data-key generate > data_key
Creating network "conjur-quickstart_default" with the default driver

test@ubuntu:~/conjur-quickstart$ cat data_key

test@ubuntu:~/conjur-quickstart$ sudo export CONJUR_DATA_KEY="$(< data_key)"
sudo: export: command not found

test@ubuntu:~/conjur-quickstart$  export CONJUR_DATA_KEY="$(< data_key)"

test@ubuntu:~/conjur-quickstart$ sudo docker-compose up -d
Creating openssl           ... done
Creating postgres_database ... done
Creating bot_app           ... done
Creating conjur_server     ... done
Creating nginx_proxy       ... done
Creating conjur_client     ... done

test@ubuntu:~/conjur-quickstart$ sudo docker ps -a
CONTAINER ID        IMAGE                            COMMAND                  CREATED             STATUS                      PORTS                           NAMES
82925d3b52be        cyberark/conjur-cli:5            "sleep infinity"         13 seconds ago      Up 12 seconds                                               conjur_client
eb750fffc3fa        nginx:1.13.6-alpine              "nginx -g 'daemon of…"   15 seconds ago      Up 13 seconds               80/tcp,>443/tcp   nginx_proxy
8a87e4416693        cyberark/conjur                  "conjurctl server"       16 seconds ago      Exited (1) 3 seconds ago                                    conjur_server
880d4e29c1d4        cfmanteiga/alpine-bash-curl-jq   "tail -F anything"       21 seconds ago      Up 17 seconds                                               bot_app
993171b4b1ea        svagi/openssl:latest             "openssl req -newkey…"   21 seconds ago      Exited (0) 18 seconds ago                                   openssl
d27e3d75680c        postgres:9.4                     "docker-entrypoint.s…"   21 seconds ago      Up 16 seconds               5432/tcp                        postgres_database
7b4b84c2c09a        hello-world                      "/hello"                 5 minutes ago       Exited (0) 5 minutes ago                                    goofy_khayyam

test@ubuntu:~/conjur-quickstart$ sudo docker-compose exec conjur conjurctl account create myConjurAccount > admin_data
ERROR: No container found for conjur_1

test@ubuntu:~/conjur-quickstart$ $

Thank you for this! I edited it a little bit by fixing some spacing issues and putting your terminal output in a code block. Let me know if you have any issues with my changes.

1 Like

Hi Jake,

No problem at all it looks a way better.


1 Like

Thanks for sharing this @Alex for the other Ubuntu users!
How has the rest of your experience been?

I ran into the same issue Alex.
I think it is because we are using docker with sudo and the environment variable is created within the users session rather than the sudo session.


1 Like

To not have to use sudo docker do the following on any *nix OS:

$ usermod -aG docker $USER

To begin not having to provide sudo right away without a terminal restart:

$ newgrp docker

Otherwise, you should restart your terminal for the new group permissions to take.