From commits-return-7944-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Mon Sep 9 22:33:22 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id CABB3180608 for ; Tue, 10 Sep 2019 00:33:21 +0200 (CEST) Received: (qmail 56461 invoked by uid 500); 9 Sep 2019 22:33:21 -0000 Mailing-List: contact commits-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list commits@zookeeper.apache.org Received: (qmail 56450 invoked by uid 99); 9 Sep 2019 22:33:21 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Sep 2019 22:33:21 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id AB69C81044; Mon, 9 Sep 2019 22:33:20 +0000 (UTC) Date: Mon, 09 Sep 2019 22:33:20 +0000 To: "commits@zookeeper.apache.org" Subject: [zookeeper] branch master updated: ZOOKEEPER-3532: Provide a docker-based environment to work on a known OS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <156806840035.21906.5782465830056526330@gitbox.apache.org> From: hanm@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: zookeeper X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 1f1211653589c98e259d043affc00c90a4c54eb7 X-Git-Newrev: a0f500bdaa04e68d60ca891b0b1f8062196df18c X-Git-Rev: a0f500bdaa04e68d60ca891b0b1f8062196df18c X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. hanm pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/zookeeper.git The following commit(s) were added to refs/heads/master by this push: new a0f500b ZOOKEEPER-3532: Provide a docker-based environment to work on a known OS a0f500b is described below commit a0f500bdaa04e68d60ca891b0b1f8062196df18c Author: Enrico Olivelli AuthorDate: Mon Sep 9 15:33:07 2019 -0700 ZOOKEEPER-3532: Provide a docker-based environment to work on a known OS Just run dev/docker/run.sh and you will have a Linux environment with all that is needed to build ZooKeeper, even on MacOs. The original idea patch was from Sijie Guo (sijie), Apache BookKeeper project. The script creates a local image that accesses the local filesystem with the current user (UID), this way the container can work on local files without problems of ownership of files. Author: Enrico Olivelli Reviewers: maoling , Michael Han Closes #1075 from eolivelli/fix/docker-env --- dev/docker/Dockerfile | 23 ++++++++++++++++ dev/docker/run.sh | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) diff --git a/dev/docker/Dockerfile b/dev/docker/Dockerfile new file mode 100644 index 0000000..0feb31b --- /dev/null +++ b/dev/docker/Dockerfile @@ -0,0 +1,23 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +FROM maven:3.6.1-jdk-11 + +RUN apt-get update +RUN apt-get install -y g++ cmake autoconf libcppunit-dev libtool diff --git a/dev/docker/run.sh b/dev/docker/run.sh new file mode 100755 index 0000000..9011310 --- /dev/null +++ b/dev/docker/run.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e -x -u + +SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) + +export IMAGE_NAME="zookeeper/dev" + +pushd ${SCRIPT_DIR} + +docker build --rm=true -t ${IMAGE_NAME} . + +popd + +if [ "$(uname -s)" == "Linux" ]; then + USER_NAME=${SUDO_USER:=$USER} + USER_ID=$(id -u "${USER_NAME}") + GROUP_ID=$(id -g "${USER_NAME}") + LOCAL_HOME=$(realpath ~) +else # boot2docker uid and gid + USER_NAME=$USER + USER_ID=1000 + GROUP_ID=50 + LOCAL_HOME="/Users/${USER_NAME}" +fi + +docker build -t "${IMAGE_NAME}-${USER_NAME}" - <