Skip to content

Commit

Permalink
Examples should run spies as non-root users #248 (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrK committed Jun 22, 2021
1 parent e756a20 commit 0df4c1d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/dotnet/fast-slow/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ RUN dotnet publish -o . -r $(dotnet --info | grep RID | cut -b 6- | tr -d ' ')
ENV PYROSCOPE_APPLICATION_NAME=fast-slow.dotnet.app
ENV PYROSCOPE_SERVER_ADDRESS=http://pyroscope:4040/
ENV PYROSCOPE_LOG_LEVEL=debug

RUN adduser --disabled-password --gecos --quiet pyroscope
USER pyroscope

CMD ["pyroscope", "exec", "-spy-name", "dotnetspy", "/dotnet/example"]
4 changes: 4 additions & 0 deletions examples/dotnet/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ RUN dotnet publish -o . -r $(dotnet --info | grep RID | cut -b 6- | tr -d ' ')
ENV PYROSCOPE_APPLICATION_NAME=web.dotnet.app
ENV PYROSCOPE_SERVER_ADDRESS=http://pyroscope:4040/
ENV PYROSCOPE_LOG_LEVEL=debug

RUN adduser --disabled-password --gecos --quiet pyroscope
USER pyroscope

CMD ["pyroscope", "exec", "dotnet", "/dotnet/example.dll"]
4 changes: 4 additions & 0 deletions examples/golang/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ COPY main.go ./main.go

RUN go get -d ./
RUN go build -o main .

RUN adduser --disabled-password --gecos --quiet pyroscope
USER pyroscope

CMD ["./main"]
4 changes: 4 additions & 0 deletions examples/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ COPY main.php ./main.php
ENV PYROSCOPE_APPLICATION_NAME=simple.php.app
ENV PYROSCOPE_SERVER_ADDRESS=http://pyroscope:4040/
ENV PYROSCOPE_LOG_LEVEL=debug

RUN adduser --disabled-password --gecos --quiet pyroscope
USER pyroscope

CMD ["pyroscope", "exec", "php", "main.php"]
4 changes: 4 additions & 0 deletions examples/python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ COPY main.py ./main.py
ENV PYROSCOPE_APPLICATION_NAME=simple.python.app
ENV PYROSCOPE_SERVER_ADDRESS=http://pyroscope:4040/
ENV PYROSCOPE_LOG_LEVEL=debug

RUN adduser --disabled-password --gecos --quiet pyroscope
USER pyroscope

CMD ["pyroscope", "exec", "python", "main.py"]
5 changes: 5 additions & 0 deletions examples/ruby/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ COPY main.rb ./main.rb

ENV PYROSCOPE_APPLICATION_NAME=simple.ruby.app
ENV PYROSCOPE_SERVER_ADDRESS=http://pyroscope:4040/
ENV PYROSCOPE_LOG_LEVEL=debug

RUN adduser --disabled-password --gecos --quiet pyroscope
USER pyroscope

CMD ["pyroscope", "exec", "ruby", "main.rb"]

0 comments on commit 0df4c1d

Please sign in to comment.