Skip to content

Docker command error #102

@jtanadi

Description

@jtanadi

Description

On running docker build, I ran into an issue with the command:

RUN touch /data/production.db

The error:

touch: /data/production.db: No such file or directory
The command '/bin/sh -c touch /data/production.db' returned a non-zero code: 1

Expected result

The container to be built successfully

Actual result

The build process stops because of the error above. Seems like the data/ directory doesn't exist in the app/ directory in the container.

Fix (maybe)

I was able to circumvent this by copying the entire working directory into app/ and running touch ./data/production.db. Can also submit a PR if this is a good fix.

Dockerfile:

# Use Node version 10
FROM mhart/alpine-node:10

# Lock python to 2.7 somehow TODO:
RUN apk update && apk add python make g++ git

WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY . /app # updated
COPY .env.example .env

ENV PORT=8081

RUN touch ./data/production.db # updated

EXPOSE 8081
CMD [ "npm", "start" ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions