Tuesday, October 24, 2017


Portainer is one of the major Open Source tools for graphically managing Docker environments. You can use portainer on any machine and direct it to a Docker API endpoint to manage s390x.

Update 2017/11/08: starting today, portainer/portainer comes with s390x support. Check out containerz.blogspot.com/2017/11/portainer-revisited.html for details; the steps below are not required anymore to run portainer.

If you prefer running it on s390x, there are some steps needed, as long as portainer doesn't build it for s390x:
Install all the pre-reqs (golang, node; also docker needs to be at a decent level >= 17.05 to support multi-stage Dockerfiles):
apt-get install -y golang npm nodejs-legacy
npm install -g bower grunt
npm install autoprefixer cssnano load-grunt-tasks \
   grunt-config grunt-contrib-clean grunt-contrib-concat \
   grunt-contrib-copy grunt-contrib-jshint \
   grunt-contrib-uglify grunt-contrib-watch \
   grunt-filerev grunt-html2js grunt-karma \
   grunt-postcss grunt-replace grunt-shell grunt-usemin
(apt is Ubuntu-specific, use appropriate tooling to install on other distributions).
Next, the build and portainer base container need to be built:
git clone https://github.com/portainer/golang-builder.git
cd golang-builder/builder-cross
docker build -t portainer/golang-builder:cross-platform .
cd ../..

git clone https://github.com/portainer/docker-images.git
cd docker-images/base-docker-binary
Update 10/26: alpine is multi-arch, so no need anymore to change the Dockerfile.
docker build -t portainer/base .
cd ../..
So let's build portainer:
git clone https://github.com/portainer/portainer.git
cd portainer
git checkout 1.15.0

bower install --allow-root
npm install
Now gruntfile.js contains amd64 and should have s390x -- replace the first three occurrences, i.e. in grunt.registerTask and the docker run command). A PR for (a cleaner implementation of) that is merged upstream meanwhile, so with 1.15.1, this will not be needed anymore.
If you like, you can now use grunt build and grunt run-dev to run portainer locally without building a container image. To build a container image, edit build.sh: at the end of the file, the build_all statement declares the target platforms. Make this a build_all 'linux-s390x' (or just add linux-s390x to the list to build for all platforms). This last change is upstream already.
./build.sh 1.15.0
To run portainer, create a data directory and start the container:
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /opt/portainer:/data portainer/portainer:linux-s390x
You can now point your browser to port 9000 and use portainer:
PS: someone asked about the node info... here are two screenshots:

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.