Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker run #50

Merged
merged 6 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
Loading