https://pulumi.com logo
#general
Title
# general
a

alert-garage-57347

12/11/2022, 4:29 AM
Hey guys. I'm unable to install Pulumi when building a Docker container for local dev. The problem is that in the official install script,
TARBALL_DEST=$(mktemp -t pulumi.tar.gz.XXXXXXXXXX)
works but
EXTRACT_DIR=$(mktemp -d pulumi.XXXXXXXXXX)
fails with permission denied. Does anyone know how to fix this?
Dockerfile:
Copy code
FROM rust:1.65.0

WORKDIR /app

ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
    && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME

RUN mkdir /app/target
RUN chown $USERNAME:$USERNAME /app/target
USER $USERNAME

ARG HOME_TMPDIR="/home/$USERNAME/.tmp"
RUN mkdir "$HOME_TMPDIR"
RUN chmod -R 777 "$HOME_TMPDIR"
RUN curl -fsSL <https://get.pulumi.com> | TMPDIR="$HOME_TMPDIR" sh
RUN rustup component add rustfmt clippy
RUN cargo install sqlx-cli

CMD ["echo", "Container is running"]
the error:
Copy code
[2022-12-11T04:32:28.502Z] + Extracting to /home/vscode/.pulumi/bin
[2022-12-11T04:32:28.503Z] mktemp: failed to create directory via template 'pulumi.XXXXXXXXXX': Permission denied
[2022-12-11T04:32:28.503Z] 
We're sorry, but it looks like something might have gone wrong during installation.
If you need help, please join us on <https://slack.pulumi.com/>
[2022-12-11T04:32:28.712Z] The command '/bin/sh -c curl -fsSL <https://get.pulumi.com> | TMPDIR="$HOME_TMPDIR" sh' returned a non-zero code: 1
I figured that when it was creating the temp directory, it didn't use
-t
so it was trying to create under
/
directory. I managed to work around this by changing the Dockerfile RUN line to
RUN cd /tmp && (curl -fsSL <https://get.pulumi.com> | sh) && cd -
but I wonder why
-t
was not provided in the official install script?
e

echoing-dinner-19531

12/12/2022, 12:07 AM
Sounds like a bug, I'll see if I can get that changed.