-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.act
More file actions
44 lines (39 loc) · 1.5 KB
/
Dockerfile.act
File metadata and controls
44 lines (39 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Dockerfile for running GitHub Actions locally with act
FROM ubuntu:24.04
# Install dependencies
RUN apt-get update && apt-get install -y \
curl \
wget \
git \
jq \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Install Go
ARG GO_VERSION=1.25.1
RUN curl -fsSL https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz | \
tar -xz -C /usr/local && \
ln -s /usr/local/go/bin/go /usr/local/bin/go && \
ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt
# Install act (try multiple sources for reliability)
RUN set -e; \
# Try known good version first
if curl -fsSL -o /tmp/act.tar.gz "https://github.com/nektos/act/releases/download/v0.2.57/act_linux_amd64.tar.gz" 2>/dev/null; then \
tar -xz -C /usr/local/bin -f /tmp/act.tar.gz && chmod +x /usr/local/bin/act && rm /tmp/act.tar.gz; \
else \
# Fallback: get latest from releases page
mkdir -p /tmp && cd /tmp && \
LATEST_URL=$(curl -s https://api.github.com/repos/nektos/act/releases | grep -i "browser_download_url.*linux_amd64.tar.gz" | head -1 | cut -d'"' -f4) && \
if [ -n "$LATEST_URL" ]; then \
curl -fsSL -o act.tar.gz "$LATEST_URL" && \
tar -xz -C /usr/local/bin -f act.tar.gz && \
chmod +x /usr/local/bin/act && \
rm act.tar.gz; \
else \
echo "Warning: Could not install act, continuing without it"; \
fi; \
fi
# Set working directory
WORKDIR /workspace
# Default command
ENTRYPOINT ["act"]
CMD ["--help"]