Launching Docker Containers requires "Chef License Acceptance"

#1

Launching Docker Containers as a part of the “Try Habitat” Module from learn.chef.io, returns Chef License Agreement issue.

Here is the output I received from Step 8 when following the module:

docker-compose -p habquickstart up
Starting habquickstart_web-1_1 ... done
Starting habquickstart_web-2_1 ... done
Starting habquickstart_load-balancer_1 ... done
Attaching to habquickstart_web-1_1, habquickstart_web-2_1, habquickstart_load-balancer_1
web-1_1          | ✗✗✗
web-1_1          | ✗✗✗ License agreement not accepted
web-1_1          | ✗✗✗
load-balancer_1  | ✗✗✗
load-balancer_1  | ✗✗✗ License agreement not accepted
load-balancer_1  | ✗✗✗
web-1_1          | +---------------------------------------------+
web-1_1          |
web-1_1          |             Chef License Acceptance
web-1_1          |
web-1_1          |
web-1_1          | Before you can continue, 1 product license must be accepted.
web-1_1          | View the license at https://www.chef.io/end-user-license-agreement
web-1_1          |
web-1_1          | License that needs accepting:
web-1_1          |
web-1_1          |   * Habitat
web-1_1          |
web-1_1          | Do you accept the 1 product license? [yes/No/quit]
web-1_1          | If you do not accept this license you will not be able to use Chef products.
web-1_1          |
web-1_1          | Do you accept the 1 product license? [yes/No/quit]
web-1_1          | +---------------------------------------------+
web-1_1          |
web-2_1          | +---------------------------------------------+
web-2_1          |
web-2_1          |             Chef License Acceptance
web-2_1          |
web-2_1          |
web-2_1          | Before you can continue, 1 product license must be accepted.
web-2_1          | View the license at https://www.chef.io/end-user-license-agreement
web-2_1          |
web-2_1          | License that needs accepting:
web-2_1          |
web-2_1          |   * Habitat
web-2_1          |
web-2_1          | Do you accept the 1 product license? [yes/No/quit]
web-2_1          | If you do not accept this license you will not be able to use Chef products.
web-2_1          |
web-2_1          | Do you accept the 1 product license? [yes/No/quit]
web-2_1          | +---------------------------------------------+
web-2_1          |
load-balancer_1  | +---------------------------------------------+
load-balancer_1  |
load-balancer_1  |             Chef License Acceptance
load-balancer_1  |
load-balancer_1  |
load-balancer_1  | Before you can continue, 1 product license must be accepted.
load-balancer_1  | View the license at https://www.chef.io/end-user-license-agreement
load-balancer_1  |
load-balancer_1  | License that needs accepting:
load-balancer_1  |
load-balancer_1  |   * Habitat
load-balancer_1  |
load-balancer_1  | Do you accept the 1 product license? [yes/No/quit]
load-balancer_1  | If you do not accept this license you will not be able to use Chef products.
load-balancer_1  |
load-balancer_1  | Do you accept the 1 product license? [yes/No/quit]
load-balancer_1  | +---------------------------------------------+
load-balancer_1  |
web-2_1          | ✗✗✗
web-2_1          | ✗✗✗ License agreement not accepted
web-2_1          | ✗✗✗
habquickstart_web-1_1 exited with code 1
habquickstart_web-2_1 exited with code 1
habquickstart_load-balancer_1 exited with code 1

How to accept this License Agreement?
Is it a part of hab cli setup?

#2

Maybe is it because of the recent update on License: https://www.chef.io/end-user-license-agreement/

and the Document was written with hab/0.56.0 version?

I’m currently running at:
hab 0.81.0/20190507225645

#3

Try adding the HAB_LICENSE environment variable to the docker compose file. E.g.:

version: '3'
services:
  web-1:
    environment: 
      - HAB_LICENSE=accept-no-persist
    image: $HAB_ORIGIN/webapp
#4

Perfect!

Thank you @qubitrenegade.

l think an update is needed on https://github.com/learn-chef/hab-two-tier repo to have this environment variable.

I cloned the above repo as a part of the tutorial on learn.chef.io Try Habitat module Step 3.

#5

I’ve opened PR #12 to address this issue.

1 Like
#6

hab license accept is another command that I just learned at #chefconf will also solve the above problem. (This can be done as a part of hab cli setup)

It actually stores the accepted license under ~/.hab/accepted-licenses/

Doing this work without being adding this HAB_LICENSE=accept-no-persist to the command line.