File tree Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ .bundle /
2+ .gem_rbs_collection /
3+ .git /
4+ .yardoc /
5+ doc /
6+ vendor /
7+ ** /* .so
8+ ** /* .bundle
Original file line number Diff line number Diff line change @@ -131,6 +131,19 @@ Run `bundle exec rake build_all`.
131131
132132See ` bundle exec rake -T ` for more tasks.
133133
134+ ### Build in docker container
135+ e.g.
136+
137+ ``` bash
138+ docker build --file=_dockerfiles/alpine.dockerfile -t go-gem-wrappper .
139+ # or
140+ docker build --file=_dockerfiles/alpine.dockerfile -t go-gem-wrappper --build-arg GO_VERSION=1.23 --build-arg RUBY_VERSION=3.4 .
141+
142+ docker run --rm -it go-gem-wrappper sh
143+ ```
144+
145+ Run ` bundle exec rake build_all ` in container.
146+
134147### See ` godoc ` in local
135148``` bash
136149go install golang.org/x/tools/cmd/godoc@latest
Original file line number Diff line number Diff line change 1+ ARG GO_VERSION=1.23
2+ ARG RUBY_VERSION=3.4
3+ ARG ALPINE_VERSION=3.21
4+
5+ FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS golang
6+
7+ FROM ruby:${RUBY_VERSION}-alpine${ALPINE_VERSION}
8+
9+ RUN apk update && \
10+ apk add --no-cache git alpine-sdk libffi-dev \
11+ gdb strace binutils valgrind # for debug in container
12+
13+ COPY --from=golang /usr/local/go /usr/local/go
14+ COPY --from=golang /go /go
15+
16+ ENV PATH=/go/bin:/usr/local/go/bin:$PATH \
17+ GOPATH=/go \
18+ GOLANGCI_LINT_VERSION=v1.60.3
19+
20+ RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s ${GOLANGCI_LINT_VERSION}
21+
22+ WORKDIR /app
23+
24+ COPY Gemfile Gemfile.lock ./
25+ COPY _gem/go_gem.gemspec _gem/
26+ COPY _gem/lib/go_gem/version.rb _gem/lib/go_gem/
27+
28+ RUN bundle config --local path vendor/bundle/ && \
29+ bundle config --local deployment true && \
30+ bundle install --jobs 4
31+
32+ COPY . .
You can’t perform that action at this time.
0 commit comments