diff --git a/Dockerfile/restaraunt_visits_without_frameworks/Dockerfile b/Dockerfile/restaraunt_visits_without_frameworks/Dockerfile new file mode 100644 index 00000000..d0ae41b5 --- /dev/null +++ b/Dockerfile/restaraunt_visits_without_frameworks/Dockerfile @@ -0,0 +1,47 @@ +# Copyright 2022 OpenMined. +# +# Licensed 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. + + +# base image +FROM ubuntu:20.04 + +# maintainer +MAINTAINER wenhui zhang + +# commands executed in terminal +RUN set -x + +# build deps +RUN apt-get update +RUN apt-get -y install git +RUN apt-get -y install libssl-dev +RUN apt-get -y install ca-certificates +RUN apt-get -y install curl +RUN apt-get -y install gnupg +RUN apt-get -y install lsb-release +#RUN apt-get -y install default-jre +RUN apt-get -y install python3 python3-pip + +RUN pip3 install pandas pipeline-dp absl-py +#apache-beam absl-py + + +# download source +RUN git clone https://github.com/OpenMined/PipelineDP.git +RUN cd /PipelineDP && git checkout v0.2.0 + +# check modes and run example + +RUN python3 /PipelineDP/examples/restaraunt_visits/run_without_frameworks.py --input_file=/PipelineDP/examples/restaraunt_visits/restaraunts_week_d +RUN cat /PipelineDP/examples/restaraunt_visits/out.txt diff --git a/README.md b/README.md index a77696b9..e9085cbc 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,45 @@ sample of it. Here's how to take a subset of the data in bash: 3. Run `python movie_view_ratings.py --input_file= --output_file=<...>` +## Dockerfile to tryout +To build and test a Dockerfile, please: +``` +cd ./Dockerfile + +docker image build -t $test_case:$version +``` + +where the `$test_case` could be examples you would like to try out, such as "restaraunt_visits_without_frameworks". + +The `$version` is a tag for image, it could be version number you would like to assign to this image, the default tag is `latest` + + +``` +cd ./Dockerfile + +docker build -t restaraunt_visits_without_frameworks/ +``` + +Then use `docker container run` to run the image. +For example: +``` +docker container run -p 8000:7000 -it restaraunt_visits_without_frameworks:latest +``` +If you would like to run with bash, then +``` +docker container run -p 8000:7000 -it restaraunt_visits_without_frameworks:latest /bin/bash +``` + +To check ID of your image, use +``` +docker container ls +``` + +To stop execution of the container instance, use +``` +docker container kill [containerID] +``` + ## Support and Community on Slack If you have questions about the PipelineDP, join