I wrote a dockerfile, put it on github and added the docker.publish action file.
It’s meant to run a small single server application on a secure Linux environment.
I chose Alpine Linux for that reason.
However, docker hub seems to have issue with this, I think?
I’m new to docker hub.
Dockerfile
# Build SafeNetwork Docker container
FROM arm64v8/alpine:latest
LABEL version="1.0"
LABEL maintainer="Folât Pjêrsômêj"
LABEL release-date="2021-01-31"
# Update and install dependencies
RUN apk update
RUN apk add bash #unix shell to run install script
RUN apk add curl #cUrl to transfer data
RUN apk add jq #Json processor to locate maidsafe's lastest tarball releases urls.
RUN apk add cargo #Install the rust package manager
# Make profile file with exported PATH and refresh the shell (while building)
SHELL ["/bin/bash", "--login", "-c"]
RUN echo 'export PATH=$PATH:/root/.safe/cli' > ~/.profile && source ~/.profile
# Set ENV PATH (after build will be used to find the safe node command)
ENV PATH=$PATH:/root/.safe
# Create safe folders
RUN mkdir -p ~/.safe/{node,cli}
# Install the safe network node
RUN curl -L $(curl --silent https://api.github.com/repos/maidsafe/safe_network/releases/latest \
| jq --arg PLATFORM_ARCH "$(echo `uname -m`)" \
-r '.assets[] | select(.name | endswith($PLATFORM_ARCH+"-unknown-linux-musl.tar.gz")).browser_download_url') \
| tar xz -C ~/.safe/node
# Install the safe network command line interface
RUN curl -L $(curl --silent https://api.github.com/repos/maidsafe/sn_cli/releases/latest \
| jq --arg PLATFORM_ARCH "$(echo `uname -m`)" \
-r '.assets[] | select(.name | endswith($PLATFORM_ARCH+"-unknown-linux-musl.tar.gz")).browser_download_url') \
| tar xz -C ~/.safe/
# Add the fleming test network
RUN safe networks add fleming-testnet https://sn-node.s3.eu-west-2.amazonaws.com/config/node_connection_info.config
RUN safe networks switch fleming-testnet
# Join the safe network
RUN safe node join
# Expose PORT of the node
EXPOSE 12000
# Launch safe on Docker command
CMD ["safe"]
log output on github actions
Run docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ghcr.io/safenetwork-community/safenetwork-node:main
labels: org.opencontainers.image.title=safenetwork-node
org.opencontainers.image.description=Safe network node for hosting data and earning Safe Network Tokens.
org.opencontainers.image.url=https://github.com/safenetwork-community/safenetwork-node
org.opencontainers.image.source=https://github.com/safenetwork-community/safenetwork-node
org.opencontainers.image.version=main
org.opencontainers.image.created=2021-07-19T23:00:21.327Z
org.opencontainers.image.revision=d38ab70ad1c7877756681b65cca77101402ac027
org.opencontainers.image.licenses=GPL-3.0
load: false
no-cache: false
pull: false
github-token: ***
env:
REGISTRY: ghcr.io
IMAGE_NAME: safenetwork-community/safenetwork-node
Docker info
/usr/bin/docker version
Client:
Version: 20.10.7+azure
API version: 1.41
Go version: go1.13.15
Git commit: f0df35096d5f5e6b559b42c7fde6c65a2909f7c5
Built: Mon May 31 09:40:07 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server:
Engine:
Version: 20.10.7+azure
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: b0f5bc36fea9dfb9672e1e9b1278ebab797b9ee0
Built: Tue Jun 1 22:34:42 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.6+azure
GitCommit: d71fcd7d8303cbf684402823e425e9dd2e99285d
runc:
Version: 1.0.0
GitCommit: 84113eef6fc27af1b01b3181f31bbaf708715301
docker-init:
Version: 0.19.0
GitCommit:
/usr/bin/docker info
Client:
Context: default
Debug Mode: false
Plugins:
buildx: Build with BuildKit (Docker Inc., 0.5.1+azure)
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 16
Server Version: 20.10.7+azure
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: false
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version: d71fcd7d8303cbf684402823e425e9dd2e99285d
runc version: 84113eef6fc27af1b01b3181f31bbaf708715301
init version:
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 5.8.0-1036-azure
Operating System: Ubuntu 20.04.2 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 6.791GiB
Name: fv-az77-843
ID: 6JGB:KGAD:JIZK:W3I7:6SNN:GUKH:JTOD:KEID:ZBNP:W4YP:EDVO:WSTV
Docker Root Dir: /var/lib/docker
Debug Mode: false
Username: githubactions
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
/usr/bin/docker buildx build --label org.opencontainers.image.title=safenetwork-node --label org.opencontainers.image.description=Safe network node for hosting data and earning Safe Network Tokens. --label org.opencontainers.image.url=https://github.com/safenetwork-community/safenetwork-node --label org.opencontainers.image.source=https://github.com/safenetwork-community/safenetwork-node --label org.opencontainers.image.version=main --label org.opencontainers.image.created=2021-07-19T23:00:21.327Z --label org.opencontainers.image.revision=d38ab70ad1c7877756681b65cca77101402ac027 --label org.opencontainers.image.licenses=GPL-3.0 --tag ghcr.io/safenetwork-community/safenetwork-node:main --iidfile /tmp/docker-build-push-u5PGsI/iidfile --push .
#1 [internal] load build definition from Dockerfile
#1 sha256:fbe83fefa7a0839d23749b5c2483c6c3e5836dd85898e4a8e47f2cd47abb08cd
#1 transferring dockerfile: 1.78kB done
#1 DONE 0.0s
#2 [internal] load .dockerignore
#2 sha256:02b7fcf47ea2ffc5ccd097237dc63952589d851fcc2bd778b2f50d18555431ec
#2 transferring context: 2B done
#2 DONE 0.0s
#3 [internal] load metadata for docker.io/arm64v8/alpine:latest
#3 sha256:5163fd92a226ba3b0f132a44635bd5b38271ee4f8b21eb8bca7fae36b70338f8
#3 ...
#4 [auth] arm64v8/alpine:pull token for registry-1.docker.io
#4 sha256:8ec6b790ed26a5677b4c82774472060446f650158bd8675d04bd41835a3adf7d
#4 DONE 0.0s
#3 [internal] load metadata for docker.io/arm64v8/alpine:latest
#3 sha256:5163fd92a226ba3b0f132a44635bd5b38271ee4f8b21eb8bca7fae36b70338f8
#3 DONE 0.7s
#5 [ 1/13] FROM docker.io/arm64v8/alpine:latest@sha256:53b74ddfc6225e3c8cc84d7985d0f34666e4e8b0b6892a9b2ad1f7516bc21b54
#5 sha256:8dbba89caf3a11728e6a9eb0433dbb3972a03fed4fc39672641423d90ebaa054
#5 resolve docker.io/arm64v8/alpine:latest@sha256:53b74ddfc6225e3c8cc84d7985d0f34666e4e8b0b6892a9b2ad1f7516bc21b54 done
#5 sha256:53b74ddfc6225e3c8cc84d7985d0f34666e4e8b0b6892a9b2ad1f7516bc21b54 528B / 528B done
#5 sha256:b0e47758dc53e7391c7abf92fd56fd959bf37fb74574feba3d557b4182d15801 1.47kB / 1.47kB done
#5 sha256:58ab47519297212468320b23b8100fc1b2b96e8d342040806ae509a778a0a07a 0B / 2.71MB 0.1s
#5 sha256:58ab47519297212468320b23b8100fc1b2b96e8d342040806ae509a778a0a07a 2.71MB / 2.71MB 0.2s done
#5 extracting sha256:58ab47519297212468320b23b8100fc1b2b96e8d342040806ae509a778a0a07a
#5 extracting sha256:58ab47519297212468320b23b8100fc1b2b96e8d342040806ae509a778a0a07a 0.1s done
#5 DONE 0.4s
#6 [ 2/13] RUN apk update
#6 sha256:3b71f47369953973e2782eb4c47af014810758ed2ff45d6d1d64a0f421de4128
#6 0.282 standard_init_linux.go:228: exec user process caused: exec format error
#6 ERROR: executor failed running [/bin/sh -c apk update]: exit code: 1
------
> [ 2/13] RUN apk update:
------
error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c apk update]: exit code: 1
Error: buildx call failed with: error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c apk update]: exit code: 1