Skip to content

Commit 7e627c8

Browse files
watsonStephen Belanger
authored and
Stephen Belanger
committed
chore: add 'npm run docker:dev' to open cwd in Docker (elastic#1185)
This command will run a temporary Docker container with access to the root of your local agent directory and place you in a bash shell inside it. This allows you to test things in a Linux environment when you're not running Linux yourself.
1 parent fe8ff8a commit 7e627c8

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ TESTING.md
1414
# Folders to ignore
1515
.ci
1616
.github
17+
dev-utils
1718
docs
1819
test
1920

dev-utils/docker-compose.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: "3.7"
2+
services:
3+
nodejs-agent:
4+
image: node:12
5+
entrypoint: /bin/bash
6+
volumes:
7+
- ..:/agent

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"local:stop": "./test/script/local-deps-stop.sh",
2626
"docker:start": "docker-compose -f ./test/docker-compose.yml up -d",
2727
"docker:stop": "docker-compose -f ./test/docker-compose.yml down",
28-
"docker:clean": "./test/script/docker/cleanup.sh"
28+
"docker:clean": "./test/script/docker/cleanup.sh",
29+
"docker:dev": "docker-compose -f ./dev-utils/docker-compose.yml run --workdir=/agent nodejs-agent"
2930
},
3031
"directories": {
3132
"test": "test"

0 commit comments

Comments
 (0)