Protocol Buffersなdockerイメージ
2314 ワード
自分用メモ。
環境
- Docker version 19.03.8
- docker-compose version 1.25.4
コード
ubuntuにprotbuf3.11.4を導入。(+GoogleAPIs)
Dockerfile
FROM ubuntu:18.04
ARG PB_VER=3.11.4
ENV GOOGLEAPIS_DIR=/googleapis
RUN cd /tmp && \
apt-get update && \
apt-get install -y curl unzip git && \
git clone https://github.com/googleapis/googleapis.git && \
mv googleapis / && \
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v${PB_VER}/protoc-${PB_VER}-linux-x86_64.zip && \
unzip protoc-${PB_VER}-linux-x86_64.zip && \
mv bin/ /usr/local/ && \
mv include/ /usr/local/ && \
rm -f *
CMD [ "protoc", "--version" ]
docker-composeで確認(手抜き)。
docker-compose.yml
version: "3.7"
services:
protobuf:
build:
context: ./
# args:
# PB_VER: 3.11.4
image: protobuf-cli:3.11.4
# command: [ protoc, --version ]
$ docker-compose run --rm protobuf
libprotoc 3.11.4
もしかしてalpineでもいける?
alpine版できました。
Author And Source
この問題について(Protocol Buffersなdockerイメージ), 我々は、より多くの情報をここで見つけました https://qiita.com/gsh-kz/items/d0ad927746178cdb1cf0著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .