forked from opencontainers/runtime-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
protobuf3: build env for using protobuf3
Don't much like doing it this way, but it's an example Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
- Loading branch information
Showing
3 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM fedora:latest | ||
|
||
ENV PROTO_VERSION 3.0.0-beta-1 | ||
RUN dnf install -y wget tar autoconf automake make gcc gcc-c++ unzip libtool | ||
RUN wget https://github.com/google/protobuf/archive/v${PROTO_VERSION}.tar.gz && \ | ||
tar xf v${PROTO_VERSION}.tar.gz | ||
WORKDIR protobuf-${PROTO_VERSION} | ||
RUN ./autogen.sh && ./configure | ||
RUN make -j$(grep ^proc /proc/cpuinfo | wc -l) | ||
RUN make install -j$(grep ^proc /proc/cpuinfo | wc -l) | ||
WORKDIR / | ||
RUN dnf install -y golang git hg bzr | ||
ENV GOPATH /gopath | ||
ENV GOBIN /usr/bin | ||
RUN go get -u github.com/golang/protobuf/{proto,protoc-gen-go} | ||
VOLUME /proto /output | ||
CMD bash /proto/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
username="protobuild" | ||
groupname="${username}" | ||
p_dir="/proto/" | ||
o_dir="/output/" | ||
|
||
uid=$(stat -c "%u" "${p_dir}") | ||
gid=$(stat -c "%g" "${p_dir}") | ||
groupadd -g "${gid}" "${groupname}" | ||
adduser -u "${uid}" -g "${gid}" "${username}" | ||
chown -R "${username}:${groupname}" "${o_dir}" | ||
cd "${p_dir}" | ||
su "${username}" -c "make go py cpp DESTDIR='${o_dir}'" | ||
|