Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

shaikh709's avatar

Laravel Sail Timezone Error

Hello,

Running curl -s https://laravel.build/example-app | bash and fails with the following error

 => ERROR [ 3/11] RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone                                                                                                                                                                           0.2s
------
 > [ 3/11] RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone:
#0 0.174 ln: failed to create symbolic link '/etc/localtime': Permission denied
------
failed to solve: executor failed running [/bin/sh -c ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone]: exit code: 1

I'm using macOS. I have not made any modifications. Just that curl command and it says permissions denied. I'm not sure what's going on here. Any idea?

Thank You :)

0 likes
3 replies
Sinnbeck's avatar

Visit the website to see the full code. Try one command at a time to see which fails

shaikh709's avatar

@Sinnbeck Thank you for your reply.

It's sail build which is failing.

following is the part RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone


LABEL maintainer="Taylor Otwell"

ARG WWWGROUP
ARG NODE_VERSION=16
ARG POSTGRES_VERSION=14

WORKDIR /var/www/html

ENV DEBIAN_FRONTEND noninteractive
ENV TZ=UTC

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update \
    && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 \
    && mkdir -p ~/.gnupg \
    && chmod 600 ~/.gnupg \
    && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf \
    && echo "keyserver hkp://keyserver.ubuntu.com:80" >> ~/.gnupg/dirmngr.conf \
    && gpg --recv-key 0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c \
    && gpg --export 0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c > /usr/share/keyrings/ppa_ondrej_php.gpg \
    && echo "deb [signed-by=/usr/share/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \
    && apt-get update \```
shaikh709's avatar

I did this and it resolved the problem ran php artisan sail:publish then in docker/8.1/Dockerfile updated first line to FROM ubuntu:latest and it resolved the issue.

1 like

Please or to participate in this conversation.