Using Docker/Fig with StrongLoop

dmathewwws

I'm having a problem using Docker/Fig to set up StrongLoop.

'slc run' works locally but it runs into an error when I run 'fig up'

I have a very basic fig file:

web:
  build: .
  command: slc run
  volumes:
    - .:/srv/data
  ports:
    - "3000:3000"
  links:
    - mysql
mysql:
    image: mysql:latest
  ports:
    - "3306:3306"
  environment:
    MYSQL_ROOT_PASSWORD:xxx

Edit: This is my Dockerfile

# Pull nodejs base image
FROM google/nodejs:0.10.30

RUN apt-get -y update

# Install stongloops
RUN npm install --global pg strongloop

#Get source code
RUN cd / && git clone https://github.com/dmathewwws/ios-api.git

# Install dependencies
RUN cd /ios-api && npm install

# Expose running port
EXPOSE 3000

WORKDIR /ios-api

This is the error returned:

Creating iosapi_mysql_1...

Traceback (most recent call last):

  File "/usr/local/bin/fig", line 9, in <module>
load_entry_point('fig==1.0.1', 'console_scripts', 'fig')()
  File "/Library/Python/2.7/site-packages/fig/cli/main.py", line 31, in main
command.sys_dispatch()
  File "/Library/Python/2.7/site-packages/fig/cli/docopt_command.py", line 21, in sys_dispatch
self.dispatch(sys.argv[1:], None)
  File "/Library/Python/2.7/site-packages/fig/cli/command.py", line 28, in dispatch
super(Command, self).dispatch(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/fig/cli/docopt_command.py", line 24, in dispatch
self.perform_command(*self.parse(argv, global_options))
  File "/Library/Python/2.7/site-packages/fig/cli/command.py", line 56, in perform_command
handler(project, command_options)
  File "/Library/Python/2.7/site-packages/fig/cli/main.py", line 427, in up
insecure_registry=insecure_registry,
  File "/Library/Python/2.7/site-packages/fig/project.py", line 174, in up
for (_, container) in service.recreate_containers(insecure_registry=insecure_registry):
  File "/Library/Python/2.7/site-packages/fig/service.py", line 199, in recreate_containers
container = self.create_container(insecure_registry=insecure_registry, **override_options)
  File "/Library/Python/2.7/site-packages/fig/service.py", line 176, in create_container
container_options = self._get_container_create_options(override_options, one_off=one_off)
  File "/Library/Python/2.7/site-packages/fig/service.py", line 371, in _get_container_create_options
container_options['environment'] = dict(resolve_env(k, v) for k, v in container_options['environment'].iteritems())
AttributeError: 'str' object has no attribute 'iteritems'
Ryan Graham

If you have copy/pasted your fig.yml accurately, it has an error in it.

To use the dictionary format for the environment variables, you need a space between MYSQL_ROOT_PASSWORD: and xxx.

mysql:
  image: mysql:latest
  ports:
    - "3306:3306"
  environment:
    MYSQL_ROOT_PASSWORD: xxx

Alternatively you can use the array form, which is a list of strings of the form VAR=val:

mysql:
  image: mysql:latest
  ports:
    - "3306:3306"
  environment:
    - MYSQL_ROOT_PASSWORD=xxx

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

What is the different between using StrongLoop's "slc run" and "node app.js"

From Dev

Meteor app with StrongLoop

From Dev

StrongLoop Loopback Yeoman Angular

From Dev

Using Push Notications in Strongloop

From Dev

Using Non-Rest Calls with Loopback (Strongloop)

From Dev

Custom response headers with Strongloop framework

From Dev

Implementing Q with Strongloop Loopback

From Dev

Stop detached strongloop application

From Dev

How to verify an foreign key in Strongloop?

From Dev

Downloading file from Strongloop loopback

From Dev

Persist Users in Strongloop Loopback

From Dev

Createmany in Strongloop Loopback

From Dev

Can not install strongloop

From Dev

StrongLoop query/stored procedure with Postgres?

From Dev

ng-lb command in StrongLoop fails when using local-storage-connector

From Dev

No Ports Assigned to Strongloop App

From Dev

Strongloop - hasOne relation

From Dev

how to filter data in include 'model' using strongloop

From Dev

Strongloop only binds to 127.0.0.1

From Dev

StrongLoop: "in" filter not working for string type

From Dev

Strongloop: currentContext not available in middleware?

From Dev

How to include and order an array using the Strongloop Loopback REST API?

From Dev

Using Push Notications in Strongloop

From Dev

Cannot connect to StrongLoop PM using StrongLoop Arc

From Dev

StrongLoop: mutual Model Relations

From Dev

Can not install strongloop

From Dev

Strongloop promise inside loop

From Dev

Strongloop AngularJS reflection services

From Dev

Strongloop/Loopback connector for gRPC