1

I'm not very familiar to docker, but I'm trying to put the frontend (written with create-react-app) into the docker container. I've found a tutorial and followed it, so my Dockerfile looks like this:

FROM node:7.8.0

ENV NPM_CONFIG_LOGLEVEL warn

RUN npm install -g serve
CMD serve -s --port 8081 build
EXPOSE 8081

COPY package.json package.json
COPY npm-shrinkwrap.json npm-shrinkwrap.json
RUN npm install

COPY . .

RUN npm run build --production

In my machine it works ok, but when I try to put it on server (raspberry pi) with docker-compose it fails.

Step 3 : RUN npm install -g serve
ERROR: Service 'frontend' failed to build: rpc error: code = 2 desc = "oci runtime error: exec format error"

I've googled, but haven't found exactly this problem. I even tried to put sudo before npm install, but got an error

/bin/sh: 1: sudo: not found
Daria Peters
  • 111
  • 1
  • 10
  • try to push the image to dockerhub and use it on the raspberry pi https://ropenscilabs.github.io/r-docker-tutorial/04-Dockerhub.html – Ahmad A Bazadgha Jan 25 '18 at 14:31

1 Answers1

0

You can either create your private repository locally or can push it to docker-hub and then try loading it on raspberry-pi.

Neha
  • 3,456
  • 3
  • 14
  • 26