Skip to content

Commit

Permalink
Fix the Dockerfile to allow building
Browse files Browse the repository at this point in the history
I'm having issues building reef-pi on an ARM mac. To workaround that I'm trying
to build under Docker. It appears this Dockerfile is old, and possibly not been
getting used. For example the node version it was using is very dated.

This updates the Dockerfile so at a minimum I am able to build the docker image
and within it build deb:

```
\# Build docker image and run it
$ docker build --platform=linux/amd64 -t debugreef
$ docker run -it debugreef bash

\# Within that image build reef-pi
$ make bin
$ make deb
...
Created package {:path=>"reef-pi-5.2-72-g7e5eeb6e.deb"}
```
  • Loading branch information
richievos committed Jun 12, 2022
1 parent 7e5eeb6 commit b1d61b5
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,33 @@ FROM debian:stretch
LABEL maintainer="code@reef-pi.com"

RUN apt-get update -y && \
apt-get install curl build-essential git mercurial -y
apt-get install curl build-essential git mercurial ruby-dev -y

RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get install -y nodejs && \
npm install -g npm
RUN curl https://dl.google.com/go/go1.12.4.linux-amd64.tar.gz > /tmp/go1.12.4.linux-amd64.tar.gz && \
tar xvzf /tmp/go1.12.4.linux-amd64.tar.gz -C /usr/local
RUN curl -L https://go.dev/dl/go1.13.15.linux-amd64.tar.gz > /tmp/go1.13.15.linux-amd64.tar.gz && \
tar xvzf /tmp/go1.13.15.linux-amd64.tar.gz -C /usr/local

RUN npm install --global yarn

RUN gem install bundler

ENV GOPATH=/gopath
ENV PATH="/usr/local/go/bin:${GOPATH}/bin:${PATH}"

RUN mkdir -p /gopath/src/github.com/reef-pi/reef-pi
WORKDIR /gopath/src/github.com/reef-pi/reef-pi

# Bootstrap dependencies
COPY Makefile package.json package-lock.json /gopath/src/github.com/reef-pi/reef-pi/
COPY Gemfile Gemfile.lock /gopath/src/github.com/reef-pi/reef-pi/
RUN bundle install

# Bootstrap dependencies
COPY Makefile package.json /gopath/src/github.com/reef-pi/reef-pi/
RUN npm install

COPY Gopkg.lock Gopkg.toml controller/ /gopath/src/github.com/reef-pi/reef-pi/
COPY controller/ /gopath/src/github.com/reef-pi/reef-pi/controller/
RUN make go-get

# Copy the rest of the code base for building
COPY . /gopath/src/github.com/reef-pi/reef-pi/

RUN make bin
USER 9000

1 comment on commit b1d61b5

@Xybolx
Copy link

@Xybolx Xybolx commented on b1d61b5 Feb 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to run reef-pi in a development environment inside the docker container on your local machine you need to build the image and run it with port 8080 in the container published to port 8080 outside the container and run "make start-dev" after "make bin" and "make deb".

Please sign in to comment.