Skip to content

Commit

Permalink
chore(cdk): add Dockerfile for toolkit container (aws#1569)
Browse files Browse the repository at this point in the history
Fixes aws#1302.
  • Loading branch information
jonathanmorley authored and rix0rrr committed Jan 23, 2019
1 parent d8207e3 commit f997fd2
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.dockerignore
Dockerfile
25 changes: 24 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,29 @@ If you also wish to package to all languages, make sure you have all the [toolch
$ ./pack.sh
```

### Full Docker build

Clone the repo:

```console
$ git clone git@github.com/awslabs/aws-cdk
$ cd aws-cdk
```

If you already have a local repo and you want a fresh build, run `git clean -fdx` from the root.

Build the docker image:

```console
$ docker build -t aws-cdk .
```

This allows you to run the CDK in a CDK-compatible directory with a command like:

```console
$ docker run -v $(pwd):/app -w /app aws-cdk <CDK ARGS>
```

### Partial build

In many cases, you don't really need to build the entire project. Say you want to work on the `@aws-cdk/aws-ec2` module:
Expand Down Expand Up @@ -268,7 +291,7 @@ $ BUILD_DOCS_DEV=1 ./build-docs.sh
### Tooling Assists
#### Jetbrains (WebStorm/IntelliJ)
This project uses lerna and utilizes symlinks inside nested node_modules directories. You may encounter an issue during
indexing where the IDE attempts to index these directories and keeps following links until the process runs out of
indexing where the IDE attempts to index these directories and keeps following links until the process runs out of
available memory and crashes. To fix this, you can run ```node ./scripts/jetbrains-remove-node-modules.js``` to exclude
these directories.

Expand Down
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM node:8.15-alpine

WORKDIR /app

RUN apk add --update \
bash \
git \
rsync \
zip \
python3 \
python3-dev \
py3-setuptools \
&& rm -rf /var/cache/apk/*

COPY . .

RUN ./build.sh \
&& ./link-all.sh

ENTRYPOINT ["/app/node_modules/.bin/cdk"]

0 comments on commit f997fd2

Please sign in to comment.