Skip to content

Commit

Permalink
Docker run (#50)
Browse files Browse the repository at this point in the history
* Added entrypoint to docker image.

* Added information about running in docker.

* Fix sonar issue

* Fix sonar redirect complaint

* Clean up docker image a bit
  • Loading branch information
matt- authored May 17, 2024
1 parent 54bdebc commit 33c5a4b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ To simply scan some code and see possible changes to make:
pixee fix /my/project/directory/
```

## Docker Usage

Pixee can also be run in a Docker container. This is useful if you want to run Pixee on an oerating system that does not support brew, or a CI/CD pipeline or in a containerized environment.

```
docker run --rm -it -v "${PWD}:/src" codemodder/pixee-cli fix /src
```

## F.A.Q.

### What languages are supported for fixes?
Expand Down
20 changes: 8 additions & 12 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
FROM python:3.11-rc-bullseye
WORKDIR /pixee

RUN apt-get update
ENV CODEMODDER_JAVA_VERSION=0.75.1

# Install Python 3, pip and wget
RUN apt-get install -y wget unzip openjdk-17-jre

RUN ln -s /usr/bin/python3 /usr/bin/python && \
java -version && \
python --version && \
python3 -m pip install semgrep==1.15.0 && \
python3 -m pip install codemodder

RUN wget https://github.com/pixee/codemodder-java/releases/download/v0.72.2/codemodder-java-codemods-0.72.2.zip
RUN unzip codemodder-java-codemods-0.72.2.zip
RUN apt-get update && apt-get --no-install-recommends install -y wget unzip openjdk-17-jre && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN wget --max-redirect=1 "https://github.com/pixee/codemodder-java/releases/download/v${CODEMODDER_JAVA_VERSION}/codemodder-java-codemods-${CODEMODDER_JAVA_VERSION}.zip"
RUN unzip codemodder-java-codemods-*.zip && rm codemodder-java-codemods-*.zip

RUN python3 -m pip install pixee

COPY bin ./bin
ENV PATH="${PATH}:/pixee/bin"

WORKDIR /src

ENTRYPOINT ["pixee"]

0 comments on commit 33c5a4b

Please sign in to comment.