mirror of
https://github.com/Neur0toxine/docker-golang-alpine.git
synced 2024-11-25 06:26:06 +03:00
latest go1.19 alpine with patched musl (without faccessat2)
This commit is contained in:
parent
4e5123f4bb
commit
35b2b33c75
3
.github/workflows/buildx.yml
vendored
3
.github/workflows/buildx.yml
vendored
@ -37,6 +37,9 @@ jobs:
|
||||
- path: 1.19-3.13
|
||||
tags: "1.19-3.13"
|
||||
platforms: linux/amd64,linux/arm64,linux/386
|
||||
- path: 1.19-nofaccessat2
|
||||
tags: "1.19-nofaccessat2"
|
||||
platforms: linux/amd64,linux/arm64,linux/386
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
1
.github/workflows/dockerimage.yml
vendored
1
.github/workflows/dockerimage.yml
vendored
@ -17,3 +17,4 @@ jobs:
|
||||
docker run -i $(docker build -q 1.18-3.13) /bin/sh -c "go version && bash --version && make --version && git --version && gcc --version && jq --version && curl --version && air -v && dlv version && which gocov && go-junit-report -version && dumb-init --version"
|
||||
docker run -i $(docker build -q 1.19) /bin/sh -c "go version && bash --version && make --version && git --version && gcc --version && jq --version && curl --version && air -v && dlv version && which gocov && go-junit-report -version && dumb-init --version"
|
||||
docker run -i $(docker build -q 1.19-3.13) /bin/sh -c "go version && bash --version && make --version && git --version && gcc --version && jq --version && curl --version && air -v && dlv version && which gocov && go-junit-report -version && dumb-init --version"
|
||||
docker run -i $(docker build -q 1.19-nofaccessat2) /bin/sh -c "go version && bash --version && make --version && git --version && gcc --version && jq --version && curl --version && air -v && dlv version && which gocov && go-junit-report -version && dumb-init --version"
|
||||
|
2
.github/workflows/hadolint.yml
vendored
2
.github/workflows/hadolint.yml
vendored
@ -10,5 +10,5 @@ jobs:
|
||||
- run: brew install hadolint
|
||||
- name: Lint Dockerfiles
|
||||
run: |
|
||||
hadolint {1.16,1.16-3.13,1.17,1.17-3.13,1.18,1.19}/Dockerfile
|
||||
hadolint {1.16,1.16-3.13,1.17,1.17-3.13,1.18,1.19,1.19-nofaccessat2}/Dockerfile
|
||||
hadolint --ignore=DL3047 --ignore=DL3059 --ignore=DL4001 --ignore=SC2155 {1.18-3.13/Dockerfile,1.19-3.13/Dockerfile}
|
||||
|
29
1.19-nofaccessat2/Dockerfile
Normal file
29
1.19-nofaccessat2/Dockerfile
Normal file
@ -0,0 +1,29 @@
|
||||
FROM golang:1.19-alpine
|
||||
COPY disable_faccessat2.patch /tmp/disable_faccessat2.patch
|
||||
RUN set -eux; \
|
||||
apk add --no-cache --virtual .build-deps gcc make patch git alpine-sdk && \
|
||||
apk add --no-cache --virtual .build-deps2 -X http://dl-cdn.alpinelinux.org/alpine/edge/testing gosu && \
|
||||
mkdir -p /var/cache/distfiles && \
|
||||
chmod a+w /var/cache/distfiles && \
|
||||
git clone --depth 1 --branch "v$(cat /etc/alpine-release)" git://git.alpinelinux.org/aports /tmp/aports && \
|
||||
cd /tmp/aports/main/musl && \
|
||||
mv /tmp/disable_faccessat2.patch /tmp/aports/main/musl/ && \
|
||||
sed -i -E 's/\thandle-aux-at_base.patch/\thandle-aux-at_base.patch\n\tdisable_faccessat2.patch/' APKBUILD && \
|
||||
adduser -S builder -G abuild && \
|
||||
chown -R builder:abuild /tmp/aports && \
|
||||
gosu builder:abuild sh -c 'abuild checksum && abuild-keygen -an && abuild -r' && \
|
||||
find /home/builder -iname './*.apk' -exec apk add --allow-untrusted --no-cache {} \;; \
|
||||
gosu builder:abuild sh -c 'abuild clean && abuild cleancache' && \
|
||||
apk del --no-network .build-deps && \
|
||||
apk del --no-network .build-deps2 && \
|
||||
deluser builder && \
|
||||
rm -rf /home/builder
|
||||
RUN set -eux; \
|
||||
apk add --no-cache bash make git gcc libc-dev jq curl dumb-init && \
|
||||
go install github.com/go-delve/delve/cmd/dlv@latest && \
|
||||
go install github.com/cosmtrek/air@latest && \
|
||||
go install github.com/jstemmer/go-junit-report@latest && \
|
||||
go install github.com/axw/gocov/gocov@latest && \
|
||||
chmod -R 777 "$GOPATH"
|
||||
WORKDIR /
|
||||
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
14
1.19-nofaccessat2/disable_faccessat2.patch
Normal file
14
1.19-nofaccessat2/disable_faccessat2.patch
Normal file
@ -0,0 +1,14 @@
|
||||
--- musl-1.2.3/src/unistd/faccessat.c 2022-04-07 20:12:40.000000000 +0300
|
||||
+++ musl-1.2.3-nofaccessat2/src/unistd/faccessat.c 2022-08-05 17:24:41.000000000 +0300
|
||||
@@ -25,11 +25,6 @@
|
||||
|
||||
int faccessat(int fd, const char *filename, int amode, int flag)
|
||||
{
|
||||
- if (flag) {
|
||||
- int ret = __syscall(SYS_faccessat2, fd, filename, amode, flag);
|
||||
- if (ret != -ENOSYS) return __syscall_ret(ret);
|
||||
- }
|
||||
-
|
||||
if (flag & ~AT_EACCESS)
|
||||
return __syscall_ret(-EINVAL);
|
||||
|
Loading…
Reference in New Issue
Block a user