Issue in creating containers
itsamittomar
FREEOP

10 months ago

I am getting issue while creating containers

importing to docker

375ms

Build time: 63.66 seconds

=========================

Container failed to start

=========================

The executable cd could not be found

.

$10 Bounty

5 Replies

Railway
BOT

10 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


Railway

Hey there! We've found the following might help you get unblocked faster: - [🧵 The executable 'cd' could not be found.](https://station.railway.com/questions/the-executable-cd-could-not-be-found-2c441b11) - [🧵 Build keeps failing](https://station.railway.com/questions/build-keeps-failing-6647eb88) - [🧵 The executable `/bin/sh` could not be found.](https://station.railway.com/questions/the-executable-bin-sh-could-not-be-fo-964ee881) If you find the answer from one of these, please let us know by solving the thread!

10 months ago

In here


cbarr32

In here

itsamittomar
FREEOP

10 months ago

# Multi-stage Dockerfile for MediaVault on Railway

# Stage 1: Build the React frontend
FROM node:18-slim AS frontend-build
WORKDIR /app

# Copy frontend package files
COPY package*.json ./

# Workaround for npm optional dependencies bug
RUN rm -f package-lock.json && \
    npm cache clean --force && \
    npm install --no-optional && \
    npm install @rollup/rollup-linux-x64-gnu --save-optional

# Copy frontend source (exclude backend and node_modules)
COPY src ./src
COPY index.html ./
COPY vite.config.ts ./
COPY tailwind.config.js ./
COPY postcss.config.js ./
COPY tsconfig*.json ./
COPY components.json ./

# Build the frontend
RUN npm run build

# Stage 2: Build the Go backend
FROM golang:1.24-alpine AS backend-build
WORKDIR /app

# Install dependencies
RUN apk add --no-cache git

# Copy backend source
COPY backend/ ./

# Download Go dependencies
RUN go mod download

# Build the backend binary
RUN CGO_ENABLED=0 GOOS=linux go build -o main cmd/server/main.go

# Stage 3: Production image
FROM ubuntu:22.04
WORKDIR /app

# Install ca-certificates for HTTPS requests
RUN apt-get update && \
    apt-get install -y ca-certificates tzdata && \
    rm -rf /var/lib/apt/lists/*

# Copy the backend binary
COPY --from=backend-build /app/main .

# Copy the frontend build
COPY --from=frontend-build /app/dist ./static

# Make binary executable
RUN chmod +x ./main

# Use Railway's $PORT environment variable
EXPOSE 8080

thats my docker file i have removed start but still getting the issue


itsamittomar

``` # Multi-stage Dockerfile for MediaVault on Railway # Stage 1: Build the React frontend FROM node:18-slim AS frontend-build WORKDIR /app # Copy frontend package files COPY package*.json ./ # Workaround for npm optional dependencies bug RUN rm -f package-lock.json && \ npm cache clean --force && \ npm install --no-optional && \ npm install @rollup/rollup-linux-x64-gnu --save-optional # Copy frontend source (exclude backend and node_modules) COPY src ./src COPY index.html ./ COPY vite.config.ts ./ COPY tailwind.config.js ./ COPY postcss.config.js ./ COPY tsconfig*.json ./ COPY components.json ./ # Build the frontend RUN npm run build # Stage 2: Build the Go backend FROM golang:1.24-alpine AS backend-build WORKDIR /app # Install dependencies RUN apk add --no-cache git # Copy backend source COPY backend/ ./ # Download Go dependencies RUN go mod download # Build the backend binary RUN CGO_ENABLED=0 GOOS=linux go build -o main cmd/server/main.go # Stage 3: Production image FROM ubuntu:22.04 WORKDIR /app # Install ca-certificates for HTTPS requests RUN apt-get update && \ apt-get install -y ca-certificates tzdata && \ rm -rf /var/lib/apt/lists/* # Copy the backend binary COPY --from=backend-build /app/main . # Copy the frontend build COPY --from=frontend-build /app/dist ./static # Make binary executable RUN chmod +x ./main # Use Railway's $PORT environment variable EXPOSE 8080 ``` thats my docker file i have removed start but still getting the issue

vedmaka
HOBBY

10 months ago

Could you share your CMD or ENTRYPOINT command that you have on your dockerfile, or the start command that you use on the Railway?


vedmaka
HOBBY

10 months ago

🤖


Welcome!

Sign in to your Railway account to join the conversation.

Loading...