Skip to content

Commit

Permalink
Fix #314 (#315)
Browse files Browse the repository at this point in the history
* Fix #314

* Remove pip 2 commands
  • Loading branch information
LazarusX authored Sep 10, 2018
1 parent 2fc7b1e commit 6358655
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
13 changes: 4 additions & 9 deletions docker/tool/linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
FROM iotedgedev-linux-base
ARG IOTEDGEDEV_VERSION
COPY iotedgedev-$IOTEDGEDEV_VERSION-py2.py3-none-any.whl dist/iotedgedev-$IOTEDGEDEV_VERSION-py2.py3-none-any.whl
RUN pip install dist/iotedgedev-$IOTEDGEDEV_VERSION-py2.py3-none-any.whl
RUN export LC_ALL=C.UTF-8 && \
export LANG=C.UTF-8

RUN useradd -m iotedgedev && \
echo 'iotedgedev ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
chown -R iotedgedev:iotedgedev .

USER iotedgedev
RUN sudo -H pip3 install dist/iotedgedev-$IOTEDGEDEV_VERSION-py2.py3-none-any.whl && \
sudo rm -rf dist/
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
22 changes: 15 additions & 7 deletions docker/tool/linux/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,26 @@ RUN AZ_REPO=$(lsb_release -cs) && \
tee /etc/apt/sources.list.d/azure-cli.list && \
apt-key adv --keyserver packages.microsoft.com --recv-keys 52E16F86FEE04B979B07E28DB02C46DF417A0893 && \
apt-get update && apt-get install azure-cli
RUN apt-get update && az extension add --name azure-cli-iot-ext && \
RUN apt-get update && \
npm i npm@latest -g && \
npm i -g iothub-explorer yo generator-azure-iot-edge-module && \
apt-get install -y --no-install-recommends python-dev build-essential libssl-dev libffi-dev libxml2-dev libxslt1-dev zlib1g-dev sudo && \
rm -rf /var/lib/apt/lists/*
RUN python -m pip install --upgrade pip && \
alias python=python3 && \
alias pip=pip3 && \
python -m pip install --upgrade pip && \
pip install setuptools && \
pip install cookiecutter
RUN python3 -m pip install --upgrade pip && \
pip3 install setuptools && \
pip3 install cookiecutter
WORKDIR /home/iotedge
COPY install-dev.sh /scripts/install-dev.sh
RUN sed -i 's/\r//' /scripts/install-dev.sh

# Switch to a non-root user because Yeoman does not work root with users
# https://github.com/Azure/iotedgedev/issues/312
RUN useradd -m iotedgedev && \
echo 'iotedgedev ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
chown -R iotedgedev:iotedgedev /home/iotedge
USER iotedgedev
# Azure CLI extensions are installed per user
RUN az extension add --name azure-cli-iot-ext && \
echo 'alias python=python3' >> ~/.bashrc && \
echo 'alias pip=pip3' >> ~/.bashrc
ENV DEBIAN_FRONTEND teletype

0 comments on commit 6358655

Please sign in to comment.