Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Comments on ArgumentError: could not find a temporary directory

Post

ArgumentError: could not find a temporary directory

+0
−0

Hello,

I am trying to build a docker image for contributing to the devdocs repository, however I am failing to get past the thor docs:download --all command. It fails with the below error:

. is world-writable: /devdocs
(1/680) Angular  FAILED (ArgumentError: could not find a temporary directory)

Does anybody have an idea why this is occurring?

If it helps, the thor command is using Ruby.

Below is my Dockerfile:

#
# Base layer that both dev and runtime inherit from.
#
FROM ruby:3.3.2-alpine as devdocs-base

ENV LANG=C.UTF-8

ARG USERNAME=devdocs
ARG USER_ID=1000
ARG GROUP_ID=1000
WORKDIR /devdocs
EXPOSE 9292
    

COPY Gemfile Gemfile.lock Rakefile Thorfile /devdocs/

RUN apk --update add nodejs build-base libstdc++ gzip git zlib-dev libcurl && \
    rm -rf /var/cache/apk/* /usr/lib/node_modules

RUN gem install bundler && \
    bundle config set path.system true && \
    bundle config set without test && \
    bundle install && \
    rm -rf ~/.gem /root/.bundle/cache /usr/local/bundle/cache /tmp

RUN addgroup -g $GROUP_ID $USERNAME && \
    adduser -u $USER_ID -G $USERNAME -D -h /devdocs $USERNAME && \
    chown -R $USERNAME:$USERNAME /devdocs

#
# Development Image
#
FROM devdocs-base as devdocs-dev
RUN bundle config unset without && \
    bundle install && \
    apk add --update bash curl && \
    curl -LO https://download.docker.com/linux/static/stable/x86_64/docker-26.1.4.tgz && \
    tar -xzf docker-26.1.4.tgz && \
    mv docker/docker /usr/bin && \
    rm -rf docker docker-26.1.4.tgz /tmp && \
    rm -rf ~/.gem /root/.bundle/cache /usr/local/bundle/cache 

VOLUME [ "/devdocs" ]
CMD bash

#
# Runtime Image
#
FROM devdocs-base as devdocs
ENV ENABLE_SERVICE_WORKER=true
COPY . /devdocs/
RUN thor docs:download --all && \
    thor assets:compile && \
    apk del gzip build-base git zlib-dev && \
    rm -rf /tmp
RUN chown -R $USERNAME:$USERNAME /devdocs
USER $USERNAME
CMD rackup --host 0.0.0.0 -E production

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

More context information might be useful (2 comments)
More context information might be useful
Alexei‭ wrote 6 months ago

Can you provide more information about the context? Example: the host OS, if using Docker Desktop or similar. Maybe it requires an environment variable that specifies the location for the temporary directory (e.g. TEMP, TMP, tmpdir)

zmzaps‭ wrote 6 months ago

I just found the error last night, see my answer. You're right, the mistake was in the Dockerfile, so additional context to the question was needed.