Skip to content
Browse files

Fixes to Docker and better docs/debugging

Fixes to docker ignore and readme
Add ebextensions that allow us to more easily use docker

Test Plan: manual

Reviewers: juan, jackie, halla, spang

Reviewed By: spang

Differential Revision:
  • Loading branch information...
emorikawa committed Jan 3, 2017
1 parent 06cf4fc commit 16c765df705947b7c66cf86411c468784e657be7
Showing with 56 additions and 10 deletions.
  1. +26 −5 .dockerignore
  2. +9 −0 .ebextensions/enable_docker_cli_on_ssh.config
  3. +21 −5 packages/cloud-api/
@@ -1,6 +1,27 @@



# Vim temp files

# Elastic Beanstalk Files
@@ -0,0 +1,9 @@
# This lets you log in via `eb ssh` and access the docker daemon.
# If we don't add the ec2-user to the docker group, then calls to docker
# (like `docker ps`) will fail with `Cannot connect to the Docker daemon`
# See:
command: gpasswd -a ec2-user docker
test: groups ec2-user | grep -qv docker
@@ -52,6 +52,13 @@ and Metdata for Nylas N1 desktop clients.
1. Make read-only: `chmod 400 ~/.ssh/k2-keypair.pem`
1. `ssh -i ~/.ssh/k2-keypair.pem`

## New to Docker:

1. Read [Understanding Docker](

1. Install [Docker]( on your

# Developing the Cloud Components Locally:
From the root /K2 directory:

@@ -92,18 +99,27 @@ hard-coded Amazon shell scripts.
Our Dockerfile exposes port 5100, and Elastic Beanstalk automatically maps
whatever single port is exposed to port 80 and serves it.

# Logs:

Don't use `eb logs`. It will download a static 100 lines of the
`eb-activity.log`, which only contains setup logs (no application logs).

1. `eb ssh`

1. `docker logs --follow $(docker ps --format "{{.ID}}" --filter status=running)` - This will tail and follow the application logs out of Docker. Use this to see what the app is doing.

1. `tail -f /var/log/eb-activity.log` - This shows you logs from when the
container builds. See this to see the output of `npm install` and other

# Diagnosing Deploys

Use `eb ssh` to login to the EC2 instance.

The deploys is copied to `/var/app/current`. Note that this is not the
running code. It's the starting place for `docker build` to run from. The
actual running code is within the docker container.

You can access logs with `eb logs`. NOTE: `eb logs` does NOT do a live
tail and only shows the latest copy of `/var/log/eb-activity.log`.

The best way to look at logs is to ssh into the box, then go to `/var/log/`

There are 2 common log files to look at:

1. `/var/log/eb-activity.log`. This will show you the progress of our npm

0 comments on commit 16c765d

Please sign in to comment.
You can’t perform that action at this time.