-
Notifications
You must be signed in to change notification settings - Fork 592
Use multi-arch node base image #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ManoMarks
merged 5 commits into
dockersamples:master
from
RandomByte:use-multi-arch-node-base-image
Jan 2, 2019
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4ffb5d1
Use multi-arch node:8-alpine as base image
RandomByte 3d28a24
Remove Dockerfile.arm
RandomByte f180e56
Explain custom build and re-add ARM image reference
RandomByte f891f2e
Readme: Omit '-f Dockerfile' where not needed
RandomByte 7acef58
Readme: Differentiate between ARM and armhf
RandomByte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Explain custom build and re-add ARM image reference
- Loading branch information
commit f180e56a88e405136089571a2a2b3effaa68753d
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,7 +46,35 @@ $ docker service create \ | |
| ``` | ||
|
|
||
| ## Supported architectures | ||
| The main image is based on [node:8-alpine](https://hub.docker.com/_/node/). With that it already offers support for many architectures, including ARM (so it can run on your Raspberry Pi). See below for instructions on how to run on Windows. | ||
|
|
||
| The main `dockersamples/visualizer` image supports **linux/amd64**. | ||
|
|
||
| **For ARM**, there is a pre-built image available. See [Running on ARM](#running-on-arm). | ||
|
|
||
| **For Windows**, there is a separate `Dockerfile.windows` and image. See [Running on Windows](#running-on-windows). | ||
|
|
||
| **Missing your architecture?** See [Building a custom image](#building-a-custom-image). | ||
|
|
||
| ## Running on ARM | ||
|
|
||
| [@alexellisuk](https://twitter.com/alexellisuk) has pushed an image to the Docker Hub as `alexellis2/visualizer-arm:latest` it will run the code on an ARMv6 or ARMv7 device such as the Raspberry Pi. | ||
|
|
||
| ``` | ||
| $ docker service create \ | ||
| --name=viz \ | ||
| --publish=8080:8080/tcp \ | ||
| --constraint=node.role==manager \ | ||
| --mount=type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \ | ||
| alexellis2/visualizer-arm:0.4 | ||
| ``` | ||
|
|
||
| If you would like to build the image from source run the following command: | ||
|
|
||
| ``` | ||
| $ docker build -f Dockerfile -t visualizer-arm:latest . | ||
|
||
| ``` | ||
|
|
||
| [View on Docker Hub](https://hub.docker.com/r/alexellis2/visualizer-arm/tags/) | ||
|
|
||
| ## Running on Windows | ||
|
|
||
|
|
@@ -85,7 +113,21 @@ $ip=(Get-NetIPAddress -AddressFamily IPv4 ` | |
| docker run -d -p 8080:8080 -e DOCKER_HOST=${ip}:2376 -e DOCKER_TLS_VERIFY=1 -v "$env:USERPROFILE\.docker:C:\Users\ContainerAdministrator\.docker" --name=visualizer stefanscherer/visualizer-windows | ||
| ``` | ||
|
|
||
| TODO: | ||
| ## Building a custom image | ||
| *When building for Windows, see [Running on Windows](#running-on-windows)*. | ||
|
|
||
| To build an up-to-date image for any architecture supported by [node:8-alpine](https://hub.docker.com/_/node/) (currently `amd64`, `arm32v6`, `arm32v7`, `arm64v8`, `i386`, `ppc64le` and `s390x`), execute the following command on a device of your target architecture: | ||
| ``` | ||
| $ docker build -f Dockerfile -t visualizer-custom:latest . | ||
|
||
| ``` | ||
|
|
||
| Afterwards you can start visualizer by using any of the commands stated [above](#docker-swarm-visualizer). Just replace `dockersamples/visualizer` with `visualizer-custom`. For example: | ||
| ``` | ||
| $ docker run -it -d -p 8080:8080 -v /var/run/docker.sock:/var/run/docker.sock visualizer-custom | ||
| ``` | ||
|
|
||
|
|
||
| ## TODO: | ||
| * Take out or fix how dist works | ||
| * Comment much more extensively | ||
| * Create tests and make them work better | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be more specific about "arm" - this works for
armhfonly, it won't work for 64-bit ARM such as that found on Packet's or Scaleway's servers or the Pine64 etc.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Done 👍