mirror of
https://gitea.com/gitea/runner.git
synced 2026-07-02 23:12:43 +00:00
This issue is caused by the addition of validation logic for `Host` in `http.Request` in golang 1.20.6 (see https://go-review.googlesource.com/c/go/+/507357/6/src/net/http/request.go) In `act`, when execute `ContainerExecAttach()`(see https://gitea.com/gitea/act/src/commit/22d91e3ac3740bb00e8ec044026f028f811cfb61/pkg/container/docker_run.go#L594), the actual value of `request.Host` is `"/var/run/docker.sock"`. This does not conform to the specification described in `validhostHeader`. <details> <summary>ValidHostHeader()</summary>  </details> So this PR follow upstream: https://github.com/nektos/act/pull/1917 and revert https://gitea.com/gitea/act_runner/pulls/295 Reviewed-on: https://gitea.com/gitea/act_runner/pulls/319 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: sillyguodong <gedong_1994@163.com> Co-committed-by: sillyguodong <gedong_1994@163.com>
25 lines
692 B
Docker
25 lines
692 B
Docker
FROM golang:1.20-alpine3.18 as builder
|
|
# Do not remove `git` here, it is required for getting runner version when executing `make build`
|
|
RUN apk add --no-cache make git
|
|
|
|
COPY . /opt/src/act_runner
|
|
WORKDIR /opt/src/act_runner
|
|
|
|
RUN make clean && make build
|
|
|
|
FROM docker:dind-rootless
|
|
USER root
|
|
RUN apk add --no-cache \
|
|
git bash supervisor
|
|
|
|
COPY --from=builder /opt/src/act_runner/act_runner /usr/local/bin/act_runner
|
|
COPY /scripts/supervisord.conf /etc/supervisord.conf
|
|
COPY /scripts/run.sh /opt/act/run.sh
|
|
COPY /scripts/rootless.sh /opt/act/rootless.sh
|
|
|
|
RUN mkdir /data \
|
|
&& chown rootless:rootless /data
|
|
|
|
USER rootless
|
|
ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
|