You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by m4rkmckenna <gi...@git.apache.org> on 2016/11/01 14:27:22 UTC

[GitHub] brooklyn-dist pull request #56: [DO NOT MERGE] docker image, for standalone ...

Github user m4rkmckenna commented on a diff in the pull request:

    https://github.com/apache/brooklyn-dist/pull/56#discussion_r85938600
  
    --- Diff: docker/Dockerfile ---
    @@ -0,0 +1,68 @@
    +#
    +# 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 ubuntu:latest
    +MAINTAINER Alex Heneveld "alex@cloudsoft.io"
    +
    +RUN apt-get update
    +
    +# pre-reqs for Brooklyn
    +RUN apt-get install -y default-jre
    +
    +# and for the script
    +RUN apt-get install -y ssh
    +
    +ARG debug
    +
    +# admin tools (optional)
    +RUN if [ -n "${debug}" ] ; then apt-get install -y vim ; fi
    +RUN if [ -n "${debug}" ] ; then apt-get install -y zip tar less curl ; fi
    +RUN if [ -n "${debug}" ] ; then apt-get install -y sudo ; fi
    +
    +RUN adduser brooklyn
    --- End diff --
    
    [Good practice](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/) is to not add multiple fs layers 
    
    Why not combine all the run commands into one
    ```
    RUN if [ -n "${debug}" ] ; then apt-get install -y vim ; fi \
            if [ -n "${debug}" ] ; then apt-get install -y zip tar less curl ; fi \
           if [ -n "${debug}" ] ; then apt-get install -y sudo ; fi \
           adduser brooklyn
    ```
    
    
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---