From notifications-return-1661-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Tue Sep 3 13:06:12 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 4C602180637 for ; Tue, 3 Sep 2019 15:06:12 +0200 (CEST) Received: (qmail 20535 invoked by uid 500); 3 Sep 2019 15:00:18 -0000 Mailing-List: contact notifications-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 notifications@zookeeper.apache.org Received: (qmail 20526 invoked by uid 99); 3 Sep 2019 15:00:18 -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; Tue, 03 Sep 2019 15:00:18 +0000 From: GitBox To: notifications@zookeeper.apache.org Subject: [GitHub] [zookeeper] eolivelli commented on a change in pull request #1075: ZOOKEEPER-3532 Provide a docker-based environment to work on a known OS Message-ID: <156751597158.28049.15138096874327531075.gitbox@gitbox.apache.org> Date: Tue, 03 Sep 2019 13:06:11 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit eolivelli commented on a change in pull request #1075: ZOOKEEPER-3532 Provide a docker-based environment to work on a known OS URL: https://github.com/apache/zookeeper/pull/1075#discussion_r320260359 ########## File path: 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}" - <