3

I'm doing Java development on Mac and I am trying to build an ARM docker container from my mac that will run on a Raspberry Pi 3 running Raspbian. I am able to find docker containers that will run on a Pi, but I cannot figure out how to build one myself.

I am pretty new to Docker, so explaining like I'm five would be appreciated!

Greenonline
  • 2,969
  • 5
  • 27
  • 38
TCVV
  • 31
  • 4

1 Answers1

1

As a Newcomer to Docker, I would recommend you to read at least the best practice of Docker. https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#general-guidelines-and-recommendations

To Answer your Question "How to to build a container yourself" start with a simple Hello World to understand the usage plus Intention of Docker. After that, just try To build your own Docker, you will need a Dockerfile, which is the building instructions for a Docker Container.

How to write such a Dockerfile: This should be your Task to check the best Pratice above

For additional Examples, here is a Dockerfile of mine (Ive used Golang instead of Java). After you have read the documentation I suspect you will understand it, if not just ask specific.

FROM golang:1.10.3 as builder
WORKDIR /go/src/git....../yourName/dht22
COPY . .
RUN go tool dist list | grep arm \
    && apt-get update \
    && apt-get install -y build-essential gcc-arm-linux-gnueabi \
    && go get ./... \
    && CC=arm-linux-gnueabi-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm 
       GOARM=6 go build -a -o app dht22.go

FROM arm32v6/alpine:latest
WORKDIR /go/src/git...../yourName/dht22
COPY --from=builder /go/src/git..../yourName/dht22 /app
CMD ['/app']
Phong
  • 113
  • 1
  • 10