R
Railway11mo ago
Logan

Empty Start Command

When I deploy my project to railway I get the following error, however when I run my dockerfile locally it works properly ========================= Container failed to start ========================= We failed to create a container for this image. Potential reasons for this happening are: The start command is invalid. Start command: ``
12 Replies
Percy
Percy11mo ago
Project ID: 6faf4c55-b612-44fb-9f25-1ae86f7c17be
Logan
Logan11mo ago
6faf4c55-b612-44fb-9f25-1ae86f7c17be Here's my dockerfile
# ===----------------------------------------------------------------------=== #
# Copyright (c) 2023, Modular Inc. All rights reserved.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions:
# https://llvm.org/LICENSE.txt
#
# 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.
#
# The Dockerfile is provided as reference. Please review the redistribution
# terms of the Mojo license in Section 1 (https://www.modular.com/legal/mojo)
# prior to distributing pre-built container images.
# ===----------------------------------------------------------------------=== #

# Example command line:
# Use no-cache to force docker to rebuild layers of the image by downloading the SDK from the repos
# ./build-image.sh --auth-key <your-modular-auth-key>
#

FROM ubuntu:20.04

ARG DEFAULT_TZ=America/Los_Angeles
ENV DEFAULT_TZ=$DEFAULT_TZ

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive TZ=$DEFAULT_TZ apt-get install -y \
tzdata \
vim \
nano \
sudo \
curl \
wget \
git && \
rm -rf /var/lib/apt/lists/*

# Download the latest version of minicoda py3.8 for linux x86/x64.
RUN curl -fsSL https://repo.anaconda.com/miniconda/$( wget -O - https://repo.anaconda.com/miniconda/ 2>/dev/null | grep -o 'Miniconda3-py38_[^"]*-Linux-x86_64.sh' | head -n 1) > /tmp/miniconda.sh \
&& chmod +x /tmp/miniconda.sh \
&& /tmp/miniconda.sh -b -p /opt/conda

ENV PATH=/opt/conda/bin:$PATH
RUN conda init

RUN curl https://get.modular.com | sh - && \
modular auth AUTHKEY

ARG MODULAR_HOME="/root/.modular"
ENV MODULAR_HOME=$MODULAR_HOME
ENV PATH="$PATH:$MODULAR_HOME/pkg/packages.modular.com_mojo/bin"

# Set the working directory inside the container
WORKDIR /app

# Copy the requirements file into the container
COPY requirements.txt requirements.txt

# Install Python dependencies
RUN pip3 install -r requirements.txt

# Copy the rest of the application code into the container
COPY . .

# Change permissions to allow for Apptainer/Singularity containers
RUN chmod -R a+rwX /root


CMD ["mojo", "main.mojo"]
# ===----------------------------------------------------------------------=== #
# Copyright (c) 2023, Modular Inc. All rights reserved.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions:
# https://llvm.org/LICENSE.txt
#
# 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.
#
# The Dockerfile is provided as reference. Please review the redistribution
# terms of the Mojo license in Section 1 (https://www.modular.com/legal/mojo)
# prior to distributing pre-built container images.
# ===----------------------------------------------------------------------=== #

# Example command line:
# Use no-cache to force docker to rebuild layers of the image by downloading the SDK from the repos
# ./build-image.sh --auth-key <your-modular-auth-key>
#

FROM ubuntu:20.04

ARG DEFAULT_TZ=America/Los_Angeles
ENV DEFAULT_TZ=$DEFAULT_TZ

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive TZ=$DEFAULT_TZ apt-get install -y \
tzdata \
vim \
nano \
sudo \
curl \
wget \
git && \
rm -rf /var/lib/apt/lists/*

# Download the latest version of minicoda py3.8 for linux x86/x64.
RUN curl -fsSL https://repo.anaconda.com/miniconda/$( wget -O - https://repo.anaconda.com/miniconda/ 2>/dev/null | grep -o 'Miniconda3-py38_[^"]*-Linux-x86_64.sh' | head -n 1) > /tmp/miniconda.sh \
&& chmod +x /tmp/miniconda.sh \
&& /tmp/miniconda.sh -b -p /opt/conda

ENV PATH=/opt/conda/bin:$PATH
RUN conda init

RUN curl https://get.modular.com | sh - && \
modular auth AUTHKEY

ARG MODULAR_HOME="/root/.modular"
ENV MODULAR_HOME=$MODULAR_HOME
ENV PATH="$PATH:$MODULAR_HOME/pkg/packages.modular.com_mojo/bin"

# Set the working directory inside the container
WORKDIR /app

# Copy the requirements file into the container
COPY requirements.txt requirements.txt

# Install Python dependencies
RUN pip3 install -r requirements.txt

# Copy the rest of the application code into the container
COPY . .

# Change permissions to allow for Apptainer/Singularity containers
RUN chmod -R a+rwX /root


CMD ["mojo", "main.mojo"]
Brody
Brody11mo ago
Dockerfile needs a capital D
Logan
Logan11mo ago
Has that
Brody
Brody11mo ago
do you have the start command input box in the service settings completely empty?
Logan
Logan11mo ago
No description
Logan
Logan11mo ago
Oh Let me look
Logan
Logan11mo ago
Yes
No description
Logan
Logan11mo ago
Unless you're talking about somewhere else
Brody
Brody11mo ago
give me a minimal repo to reproduce this and ill see what i can do a bit later
Logan
Logan11mo ago
Sure sounds good Update: I might have just been wrong. It seems like I can't get it running locally because it keeps failling. It must have been failling and running the old previous docker build that had succeeded. If I can get a reproducable repo of any railway only issues I'll let you know but seems like an issue that's not a railway problem for now
Brody
Brody11mo ago
sounds good! ill be around
Want results from more Discord servers?
Add your server