Skip to content

Commit

Permalink
dockerfile: Run npm link
Browse files Browse the repository at this point in the history
The currently built container image works fine if you want to
invoke artillery through a single docker command. But if you want to run
multiple artillery commands in the same container instance, or if you
want to use Artillery's container image as a base layer, then you ran
into issues such artilleryio#1394.

The issue us that the executable in the path is named `run` instead of
`artillery`. To address this while maintain compatibility for any users
depending on the existing executable we can run an `npm install` which
will setup artillery as if it had been installed globally.

Fixes artilleryio#1394.
  • Loading branch information
nzapo committed Apr 2, 2022
1 parent fef25ed commit 21b5866
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ COPY package*.json ./
RUN npm --ignore-scripts --production install

COPY . ./
RUN npm link

# keep for backwards compatibility
ENV PATH="/home/node/artillery/bin:${PATH}"

ENTRYPOINT ["/home/node/artillery/bin/run"]
ENTRYPOINT ["/usr/local/bin/artillery"]

0 comments on commit 21b5866

Please sign in to comment.