Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Commit

Permalink
Add Dockerfile and Docker install instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
robingustafsson committed Apr 1, 2019
1 parent e612433 commit e27436b
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.circleci
example
node_modules
test
.ava.json
.babelrc
.dockerignore
.git
.gitattributes
.gitignore
.npmignore
*.code-workspace
*.tgz
ava.config.js
CHANGELOG.md
Dockerfile
npm-debug.log
STYLE.md
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Dockerfile and installation instructions on how to use Docker image from DockerHub.

## [0.1.2] - 2019-03-28
### Fixed
Expand Down
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:11-alpine

RUN mkdir -p /home/node/postman-to-k6/node_modules && chown -R node:node /home/node/postman-to-k6
WORKDIR /home/node/postman-to-k6
COPY package*.json ./
USER node
COPY --chown=node:node . .
RUN npm install --production

ENTRYPOINT ["node", "bin/postman-to-k6.js"]
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Supported Features:

**Install**:

![npm](https://img.shields.io/npm/v/postman-to-k6.svg) ![npm](https://img.shields.io/npm/dw/postman-to-k6.svg)
![npm](https://img.shields.io/npm/v/postman-to-k6.svg) ![npm](https://img.shields.io/npm/dw/postman-to-k6.svg) ![dockerhub](https://img.shields.io/docker/pulls/loadimpact/postman-to-k6.svg)

Globally, and preferably using [nvm](https://github.com/creationix/nvm) (at least on Unix/Linux systems to avoid filesystem permission issues when using sudo):
```shell
Expand All @@ -34,6 +34,11 @@ npm install postman-to-k6

Note that this will require you to run the converter with `node node_modules/postman-to-k6/bin/postman-to-k6.js ...`.

Alternatively, you can install the tool from DockerHub:
```shell
docker pull loadimpact/postman-to-k6
```

**Convert**:

Pass a collection export to convert.
Expand Down Expand Up @@ -67,6 +72,15 @@ Or a data file in JSON format.
postman-to-k6 collection.json --json data.json -o k6-script.js
```

Using the Docker image, you execute the tool as follows:
```shell
docker run -it -v "/path/to/postman/collection/:/postman/" loadimpact/postman-to-k6 /postman/MyCollection.postman_collection.json -o /postman/test.js
```
and then execute the k6 test using:
```shell
k6 run /path/to/postman/collection/test.js
```

## Examples

A collection of Postman examples are located under `example`.
Expand Down

0 comments on commit e27436b

Please sign in to comment.