mirror of
https://github.com/Neur0toxine/docker-golang-alpine.git
synced 2024-11-28 16:06:04 +03:00
more utilites, removed unsupported architectures, simplified installation for delve
This commit is contained in:
parent
4b0b69d1e9
commit
a73b933299
14
.github/workflows/buildx.yml
vendored
14
.github/workflows/buildx.yml
vendored
@ -15,22 +15,22 @@ jobs:
|
|||||||
docker-file:
|
docker-file:
|
||||||
- path: 1.16
|
- path: 1.16
|
||||||
tags: "1.16"
|
tags: "1.16"
|
||||||
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7,linux/arm/v6
|
platforms: linux/amd64,linux/arm64,linux/386
|
||||||
- path: 1.16-3.13
|
- path: 1.16-3.13
|
||||||
tags: "1.16-3.13"
|
tags: "1.16-3.13"
|
||||||
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7,linux/arm/v6
|
platforms: linux/amd64,linux/arm64,linux/386
|
||||||
- path: 1.17
|
- path: 1.17
|
||||||
tags: "1.17"
|
tags: "1.17"
|
||||||
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7,linux/arm/v6
|
platforms: linux/amd64,linux/arm64,linux/386
|
||||||
- path: 1.17-3.13
|
- path: 1.17-3.13
|
||||||
tags: "1.17-3.13"
|
tags: "1.17-3.13"
|
||||||
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7,linux/arm/v6
|
platforms: linux/amd64,linux/arm64,linux/386
|
||||||
- path: 1.18
|
- path: 1.18
|
||||||
tags: "1.18"
|
tags: "1.18"
|
||||||
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7,linux/arm/v6
|
platforms: linux/amd64,linux/arm64,linux/386
|
||||||
- path: 1.18-3.13
|
- path: 1.18-3.13
|
||||||
tags: "1.18-3.13"
|
tags: "1.18-3.13"
|
||||||
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7,linux/arm/v6
|
platforms: linux/amd64,linux/arm64,linux/386
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Prepare
|
- name: Prepare
|
||||||
id: prepare
|
id: prepare
|
||||||
run: |
|
run: |
|
||||||
DOCKER_IMAGE=neur0toxine/golang-alpine-dumb-init
|
DOCKER_IMAGE=neur0toxine/golang-alpine
|
||||||
|
|
||||||
TEMP="${{ matrix.docker-file.tags }}"
|
TEMP="${{ matrix.docker-file.tags }}"
|
||||||
TAGZ=($TEMP)
|
TAGZ=($TEMP)
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
FROM golang:1.16-alpine3.13
|
FROM golang:1.16-alpine3.13
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
apk add --no-cache bash make git gcc libc-dev jq curl dumb-init && \
|
apk add --no-cache bash make git gcc libc-dev jq curl dumb-init && \
|
||||||
cd /tmp && \
|
go install github.com/go-delve/delve/cmd/dlv@latest && \
|
||||||
git clone https://github.com/go-delve/delve && \
|
|
||||||
cd delve && \
|
|
||||||
go install github.com/go-delve/delve/cmd/dlv && \
|
|
||||||
cd / && \
|
|
||||||
go install github.com/cosmtrek/air@latest && \
|
go install github.com/cosmtrek/air@latest && \
|
||||||
rm -rf delve && \
|
go install github.com/jstemmer/go-junit-report@latest && \
|
||||||
chmod -R 777 /go
|
go install github.com/axw/gocov/gocov@latest && \
|
||||||
|
chmod -R 777 "$GOPATH"
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
FROM golang:1.16-alpine
|
FROM golang:1.16-alpine
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
apk add --no-cache bash make git gcc libc-dev jq curl dumb-init && \
|
apk add --no-cache bash make git gcc libc-dev jq curl dumb-init && \
|
||||||
cd /tmp && \
|
go install github.com/go-delve/delve/cmd/dlv@latest && \
|
||||||
git clone https://github.com/go-delve/delve && \
|
|
||||||
cd delve && \
|
|
||||||
go install github.com/go-delve/delve/cmd/dlv && \
|
|
||||||
cd / && \
|
|
||||||
go install github.com/cosmtrek/air@latest && \
|
go install github.com/cosmtrek/air@latest && \
|
||||||
rm -rf delve && \
|
go install github.com/jstemmer/go-junit-report@latest && \
|
||||||
chmod -R 777 /go
|
go install github.com/axw/gocov/gocov@latest && \
|
||||||
|
chmod -R 777 "$GOPATH"
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
FROM golang:1.17-alpine3.13
|
FROM golang:1.17-alpine3.13
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
apk add --no-cache bash make git gcc libc-dev jq curl dumb-init && \
|
apk add --no-cache bash make git gcc libc-dev jq curl dumb-init && \
|
||||||
cd /tmp && \
|
go install github.com/go-delve/delve/cmd/dlv@latest && \
|
||||||
git clone https://github.com/go-delve/delve && \
|
|
||||||
cd delve && \
|
|
||||||
go install github.com/go-delve/delve/cmd/dlv && \
|
|
||||||
cd / && \
|
|
||||||
go install github.com/cosmtrek/air@latest && \
|
go install github.com/cosmtrek/air@latest && \
|
||||||
rm -rf delve && \
|
go install github.com/jstemmer/go-junit-report@latest && \
|
||||||
chmod -R 777 /go
|
go install github.com/axw/gocov/gocov@latest && \
|
||||||
|
chmod -R 777 "$GOPATH"
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
FROM golang:1.17-alpine
|
FROM golang:1.17-alpine
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
apk add --no-cache bash make git gcc libc-dev jq curl dumb-init && \
|
apk add --no-cache bash make git gcc libc-dev jq curl dumb-init && \
|
||||||
cd /tmp && \
|
go install github.com/go-delve/delve/cmd/dlv@latest && \
|
||||||
git clone https://github.com/go-delve/delve && \
|
|
||||||
cd delve && \
|
|
||||||
go install github.com/go-delve/delve/cmd/dlv && \
|
|
||||||
cd / && \
|
|
||||||
go install github.com/cosmtrek/air@latest && \
|
go install github.com/cosmtrek/air@latest && \
|
||||||
rm -rf delve && \
|
go install github.com/jstemmer/go-junit-report@latest && \
|
||||||
chmod -R 777 /go
|
go install github.com/axw/gocov/gocov@latest && \
|
||||||
|
chmod -R 777 "$GOPATH"
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
||||||
|
@ -1,20 +1,13 @@
|
|||||||
FROM alpine:3.13
|
FROM alpine:3.13
|
||||||
|
|
||||||
RUN apk add --no-cache ca-certificates
|
|
||||||
|
|
||||||
# set up nsswitch.conf for Go's "netgo" implementation
|
|
||||||
# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275
|
|
||||||
# - docker run --rm debian grep '^hosts:' /etc/nsswitch.conf
|
|
||||||
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf
|
|
||||||
|
|
||||||
ENV PATH /usr/local/go/bin:$PATH
|
ENV PATH /usr/local/go/bin:$PATH
|
||||||
|
|
||||||
ENV GOLANG_VERSION 1.18.4
|
|
||||||
|
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
|
apk add --no-cache ca-certificates jq curl; \
|
||||||
|
([ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf); \
|
||||||
apk add --no-cache --virtual .fetch-deps gnupg; \
|
apk add --no-cache --virtual .fetch-deps gnupg; \
|
||||||
arch="$(apk --print-arch)"; \
|
arch="$(apk --print-arch)"; \
|
||||||
url=; \
|
export GOVERSION="$(curl -fsSL 'https://go.dev/dl/?mode=json&include=1.18' | jq -r '.[0].version')"; \
|
||||||
case "$arch" in \
|
case "$arch" in \
|
||||||
'x86_64') \
|
'x86_64') \
|
||||||
export GOAMD64='v1' GOARCH='amd64' GOOS='linux'; \
|
export GOAMD64='v1' GOARCH='amd64' GOOS='linux'; \
|
||||||
@ -39,14 +32,10 @@ RUN set -eux; \
|
|||||||
;; \
|
;; \
|
||||||
*) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \
|
*) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \
|
||||||
esac; \
|
esac; \
|
||||||
build=; \
|
|
||||||
if [ -z "$url" ]; then \
|
|
||||||
# https://github.com/golang/go/issues/38536#issuecomment-616897960
|
# https://github.com/golang/go/issues/38536#issuecomment-616897960
|
||||||
build=1; \
|
url="https://dl.google.com/go/$GOVERSION.src.tar.gz"; \
|
||||||
url='https://dl.google.com/go/go1.18.4.src.tar.gz'; \
|
|
||||||
sha256='4525aa6b0e3cecb57845f4060a7075aafc9ab752bb7b6b4cf8a212d43078e1e4'; \
|
sha256='4525aa6b0e3cecb57845f4060a7075aafc9ab752bb7b6b4cf8a212d43078e1e4'; \
|
||||||
# the precompiled binaries published by Go upstream are not compatible with Alpine, so we always build from source here 😅
|
# the precompiled binaries published by Go upstream are not compatible with Alpine, so we always build from source here 😅
|
||||||
fi; \
|
|
||||||
\
|
\
|
||||||
wget -O go.tgz.asc "$url.asc"; \
|
wget -O go.tgz.asc "$url.asc"; \
|
||||||
wget -O go.tgz "$url"; \
|
wget -O go.tgz "$url"; \
|
||||||
@ -65,7 +54,6 @@ RUN set -eux; \
|
|||||||
tar -C /usr/local -xzf go.tgz; \
|
tar -C /usr/local -xzf go.tgz; \
|
||||||
rm go.tgz; \
|
rm go.tgz; \
|
||||||
\
|
\
|
||||||
if [ -n "$build" ]; then \
|
|
||||||
apk add --no-cache --virtual .build-deps \
|
apk add --no-cache --virtual .build-deps \
|
||||||
bash \
|
bash \
|
||||||
gcc \
|
gcc \
|
||||||
@ -94,7 +82,6 @@ RUN set -eux; \
|
|||||||
/usr/local/go/src/cmd/dist/dist \
|
/usr/local/go/src/cmd/dist/dist \
|
||||||
"$GOCACHE" \
|
"$GOCACHE" \
|
||||||
; \
|
; \
|
||||||
fi; \
|
|
||||||
\
|
\
|
||||||
apk del --no-network .fetch-deps; \
|
apk del --no-network .fetch-deps; \
|
||||||
\
|
\
|
||||||
@ -106,14 +93,11 @@ RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
|
|||||||
WORKDIR $GOPATH
|
WORKDIR $GOPATH
|
||||||
|
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
apk add --no-cache bash make git gcc libc-dev jq curl dumb-init && \
|
apk add --no-cache bash make git gcc libc-dev dumb-init && \
|
||||||
cd /tmp && \
|
go install github.com/go-delve/delve/cmd/dlv@latest && \
|
||||||
git clone https://github.com/go-delve/delve && \
|
|
||||||
cd delve && \
|
|
||||||
go install github.com/go-delve/delve/cmd/dlv && \
|
|
||||||
cd / && \
|
|
||||||
go install github.com/cosmtrek/air@latest && \
|
go install github.com/cosmtrek/air@latest && \
|
||||||
rm -rf delve && \
|
go install github.com/jstemmer/go-junit-report@latest && \
|
||||||
chmod -R 777 /go
|
go install github.com/axw/gocov/gocov@latest && \
|
||||||
|
chmod -R 777 "$GOPATH"
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
FROM golang:1.18-alpine
|
FROM golang:1.18-alpine
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
apk add --no-cache bash make git gcc libc-dev jq curl dumb-init && \
|
apk add --no-cache bash make git gcc libc-dev jq curl dumb-init && \
|
||||||
cd /tmp && \
|
go install github.com/go-delve/delve/cmd/dlv@latest && \
|
||||||
git clone https://github.com/go-delve/delve && \
|
|
||||||
cd delve && \
|
|
||||||
go install github.com/go-delve/delve/cmd/dlv && \
|
|
||||||
cd / && \
|
|
||||||
go install github.com/cosmtrek/air@latest && \
|
go install github.com/cosmtrek/air@latest && \
|
||||||
rm -rf delve && \
|
go install github.com/jstemmer/go-junit-report@latest && \
|
||||||
chmod -R 777 /go
|
go install github.com/axw/gocov/gocov@latest && \
|
||||||
|
chmod -R 777 "$GOPATH"
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
||||||
|
Loading…
Reference in New Issue
Block a user