mirror of
https://github.com/weslambert/velociraptor-docker.git
synced 2025-09-25 21:21:14 +00:00
Use Github API for latest release download
This commit is contained in:
18
Dockerfile
18
Dockerfile
@@ -6,17 +6,21 @@ ENV VERSION="0.5.1"
|
|||||||
COPY ./entrypoint .
|
COPY ./entrypoint .
|
||||||
RUN chmod +x entrypoint && \
|
RUN chmod +x entrypoint && \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get install -y wget && \
|
apt-get install -y curl wget jq && \
|
||||||
# Create dirs for Velox binaries
|
# Create dirs for Velo binaries
|
||||||
mkdir -p /opt/velociraptor && \
|
mkdir -p /opt/velociraptor && \
|
||||||
for i in linux mac windows; do mkdir -p /opt/velociraptor/$i; done && \
|
for i in linux mac windows; do mkdir -p /opt/velociraptor/$i; done && \
|
||||||
# Get Velox binaries
|
# Get Velox binaries
|
||||||
wget -O /opt/velociraptor/linux/velociraptor https://github.com/Velocidex/velociraptor/releases/download/v$VERSION/velociraptor-v$VERSION-1-linux-amd64 && \
|
WINDOWS_EXE=$(curl -s https://api.github.com/repos/velocidex/velociraptor/releases/latest | jq -r 'limit(1 ; ( .assets[].browser_download_url | select ( contains("windows-amd64.exe") )))') && \
|
||||||
wget -O /opt/velociraptor/mac/velociraptor_client https://github.com/Velocidex/velociraptor/releases/download/v$VERSION/velociraptor-v$VERSION-darwin-amd64 && \
|
WINDOWS_MSI=$(curl -s https://api.github.com/repos/velocidex/velociraptor/releases/latest | jq -r 'limit(1 ; ( .assets[].browser_download_url | select ( contains("windows-amd64.msi") )))') && \
|
||||||
wget -O /opt/velociraptor/windows/velociraptor_client.exe https://github.com/Velocidex/velociraptor/releases/download/v$VERSION/velociraptor-v$VERSION-1-windows-amd64.exe && \
|
LINUX_BIN=$(curl -s https://api.github.com/repos/velocidex/velociraptor/releases/latest | jq -r 'limit(1 ; ( .assets[].browser_download_url | select ( contains("linux-amd64") )))') && \
|
||||||
wget -O /opt/velociraptor/windows/velociraptor_client.msi https://github.com/Velocidex/velociraptor/releases/download/v$VERSION/velociraptor-v$VERSION-1-windows-amd64.msi && \
|
MAC_BIN=$(curl -s https://api.github.com/repos/velocidex/velociraptor/releases/latest | jq -r 'limit(1 ; ( .assets[].browser_download_url | select ( contains("darwin-amd64") )))') && \
|
||||||
|
wget -O /opt/velociraptor/linux/velociraptor "$LINUX_BIN" && \
|
||||||
|
wget -O /opt/velociraptor/mac/velociraptor_client "$MAC_BIN" && \
|
||||||
|
wget -O /opt/velociraptor/windows/velociraptor_client.exe "$WINDOWS_EXE" && \
|
||||||
|
wget -O /opt/velociraptor/windows/velociraptor_client.msi "$WINDOWS_MSI" && \
|
||||||
# Clean up
|
# Clean up
|
||||||
apt-get remove -y --purge wget && \
|
apt-get remove -y --purge curl wget jq && \
|
||||||
apt-get clean
|
apt-get clean
|
||||||
WORKDIR /velociraptor
|
WORKDIR /velociraptor
|
||||||
CMD ["/entrypoint"]
|
CMD ["/entrypoint"]
|
||||||
|
Reference in New Issue
Block a user