Merge pull request #1129 from ssplatt/docker-buildx

Create docker containers for multiple architectures
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2021-06-11 21:21:57 -04:00
commit ff90501e82
4 files changed
+40 -9

No files matched your search

+19 -6
View File
@@ -3,6 +3,8 @@ name: Publish Docker image
on:
push:
branches: [master, develop]
release:
types: [published, created, edited]
jobs:
publish:
@@ -19,12 +21,15 @@ jobs:
run: |
REGISTRY="ghcr.io"
IMAGE="${REGISTRY}/${{ steps.repository.outputs.lowercase }}"
TAGS="${IMAGE}:${{ github.sha }}"
if [[ $GITHUB_REF == refs/heads/master ]]; then
TAGS="${TAGS},${IMAGE}:latest"
fi
if [[ $GITHUB_REF == refs/heads/develop ]]; then
TAGS="${TAGS},${IMAGE}:develop"
TAGS="${IMAGE}:${{ github.sha }},${IMAGE}:latest"
REF=${GITHUB_REF,,}
PREFIX="$(dirname $REF)"
SUFFIX="$(basename $REF)"
if [[ $PREFIX = "refs/heads" ]]; then
TAGS="${TAGS},${IMAGE}:${SUFFIX}"
elif [[ $PREFIX = "refs/tags" ]]; then
RELEASE=${SUFFIX#"superalgos-"}
TAGS="${TAGS},${IMAGE}:${RELEASE}"
fi
echo ::set-output name=tags::${TAGS}
- name: Login in to registry
@@ -33,9 +38,17 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Push to registry
uses: docker/build-push-action@v2
with:
push: true
file: ./Docker/Dockerfile
tags: ${{ steps.prep.outputs.tags }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
+1 -1
View File
@@ -18,7 +18,7 @@ RUN mkdir -p Data-Storage Log-Files My-Workspaces \
&& useradd --no-log-init -m -g superalgos superalgos \
&& chown -R superalgos:superalgos /app
USER superalgos
RUN node setup
RUN node setup noShortcuts
EXPOSE 34248
EXPOSE 18041
VOLUME ["/app/Data-Storage", "/app/Log-Files", "/app/My-Workspaces"]
+4 -1
View File
@@ -4,7 +4,7 @@ services:
build:
context: ..
dockerfile: ./Docker/Dockerfile
image: superalgos
image: ghcr.io/superalgos/superalgos:latest
command: ["minMemo"]
ports:
- '34248:34248'
@@ -13,4 +13,7 @@ services:
- ../Data-Storage:/app/Data-Storage
- ../Log-Files:/app/Log-Files
- ../My-Workspaces:/app/My-Workspaces
environment:
- PUID: '1000'
- GUID: '1000'
restart: on-failure
+16 -1
View File
@@ -373,8 +373,23 @@ When you're done just exec `docker kill superalgos`
Follow the link to [install docker-compose](https://docs.docker.com/compose/install/)
Run `docker-compose -f Docker/docker-compose.yml up`
Run `docker-compose -f Docker/docker-compose.yml up`.
## Configure the Container Environment
### Available image tags
To avoid breaking changes, the `shasum hash` and the `release` tags are the best to use. These will generally ensure you are always running the same code. The other tags will change which code they are pointing to more frequently and without notice.
- `latest` : the absolute latest build
- `master` : the latest master branch build
- `develop` : the latest develop branch build
- `<shasum hash>` : a specific git commit hash
- `<release>` : corresponds with a Github Release (git tag), i.e. `beta-10`
### Environment variables
`PUID` and `GUID` environment variables can be used to help avoid permissions issues in the mounted volumes between the container environment and the local OS environment. The default `PUID` and `GUID` is `1000`. You can view the current user's PUID and GUID with the `id` command.
# What is Superalgos?