Commit 7cf5625 1 parent bf4139b commit 7cf5625 Copy full SHA for 7cf5625
File tree 3 files changed +11
-2
lines changed
3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,13 @@ PROJECT_ROOT=$(realpath $(dirname "$BASH_SOURCE"))
3
3
PROJECT_ROOT_DOCKER=" //ts-proto" # double slash to support git bash on windows
4
4
5
5
# Alias docker-compose to make it usable from anywhere.
6
- function _docker-compose() { docker-compose -f $PROJECT_ROOT /docker-compose.yml " $@ " ; }
6
+ function _docker-compose() {
7
+ if [ uname -a | grep arm64 ]
8
+ then
9
+ ARCH=aarch_64
10
+ fi
11
+ docker-compose -f $PROJECT_ROOT /docker-compose.yml " $@ " ;
12
+ }
7
13
8
14
# Dockerized version of protoc.
9
15
function protoc() { _docker-compose run --rm -w //host --entrypoint protoc -- protoc " $@ " ; }
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ services:
4
4
build :
5
5
context : .
6
6
dockerfile : " protoc.Dockerfile"
7
+ args :
8
+ - " ARCH=${ARCH:-x86_64}"
7
9
volumes :
8
10
- " .:/ts-proto"
9
11
- " ${PWD:-.}:/host"
Original file line number Diff line number Diff line change 1
1
# Docker image for protoc
2
2
FROM node:17-alpine3.14
3
3
ARG PROTOC_VERSION="3.19.1"
4
+ ARG ARCH="x86_64"
4
5
5
6
RUN apk add bash
6
7
RUN apk add gcompat
7
- ADD "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64 .zip" protoc.zip
8
+ ADD "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-$ARCH .zip" protoc.zip
8
9
RUN mkdir /usr/local/lib/protoc && unzip protoc.zip -d /usr/local/lib/protoc && rm protoc.zip
9
10
RUN ln -s /usr/local/lib/protoc/bin/protoc /usr/local/bin/protoc
10
11
You can’t perform that action at this time.
0 commit comments