Skip to content

User Guide (Docker)

puluter edited this page Dec 17, 2021 · 29 revisions

Intro

Package links

Example / Quickstart

Use EFC via Docker image

Prerequisites

Export your EpicGames secrets

  • Download DeviceAuthGenerator for EpicGames. Currently only Windows binary is supported. For Mac/Linux user, follow the guide in README.
  • Follow the User Guide
  • After exporting, you should have a file device_auths.json.

Install Docker

Install Docker Desktop on your PC. Make sure Docker is running.

Install Docker Engine if you're using non-PC system.

Docker version should be >= 20.10.7.

Run EFC via Docker

For V1.5.3 and below, refer Run with V1.5.3 and below chapter

  • Create a folder data
  • Put device_auths.json & config.json into data folder.

Content of config.json can be copied from config.example.json. It should look like this:

.  # <-------- your terminal should be here
└── data
    ├── device_auths.json
    └── config.json

Open CMD/Powerbash/Terminal and make sure it is currently in the folder that has data folder.

For specific version, replace latest with the version tag that is supported in EFC GithubPackage

Windows

These commands are for CMD, if you use Powershell, replace %cd% with ${PWD}

docker run --rm --pull always -it --volume "%cd%/data:/app/data" ghcr.io/jackblk/epicgames-freebies-claimer:latest

Mac/Linux

Run this command:

docker run --rm --pull always -it --volume "$(pwd)/data:/app/data" ghcr.io/jackblk/epicgames-freebies-claimer:latest

docker-compose

Directory structure:

.  # <-------- your terminal should be here
├── docker-compose.yml
└── data
    ├── device_auths.json
    └── config.json

Content of docker-compose.yml:

version: "3.2"
services:
  epic_free:
    image: ghcr.io/jackblk/epicgames-freebies-claimer:latest
    container_name: 'epic_free'
    volumes:
      - ./data:/app/data
    stdin_open: true # docker run -i
    tty: true        # docker run -t

Run it with: docker-compose run epic_free

Notification with Apprise

EFC supports sending notification with Apprise to multiple platform: Discord, Telegram, emails...

To use this feature, you need to configure config.json file in your data folder. Check out Notification with Apprise Guide.


Run with V1.5.3 and below

Change in V1.5.4

In V1.5.4, config.json history.json and device_auths.json have been moved to data folder in order to isolate config files with code. So while upgrading from V1.5.3 and below to V1.5.4, you need to change your docker run command to mount config files to data folder.

Windows

These commands are for CMD, if you use Powershell, replace %cd% with ${PWD}

Run this command:

docker run --rm --pull always -it --volume "%cd%/device_auths.json:/app/device_auths.json" ghcr.io/jackblk/epicgames-freebies-claimer:latest

Using your local history.json:

docker run --rm --pull always -it --volume "%cd%/device_auths.json:/app/device_auths.json" --volume "%cd%/history.json:/app/history.json" ghcr.io/jackblk/epicgames-freebies-claimer:latest

Mac/Linux

Run this command:

docker run --rm --pull always -it --volume "$(pwd)/device_auths.json:/app/device_auths.json" ghcr.io/jackblk/epicgames-freebies-claimer:latest

Using your local history.json:

docker run --rm --pull always -it --volume "$(pwd)/device_auths.json:/app/device_auths.json" --volume "$(pwd)/history.json:/app/history.json" ghcr.io/jackblk/epicgames-freebies-claimer:latest

docker-compose

Make a docker-compose.yml file as follows in the directory that contains device_auths.json:

version: "3.2"
  services:
    epic_free:
      image: ghcr.io/jackblk/epicgames-freebies-claimer:latest
      container_name: 'epic_free'
      volumes:
        - ./device_auths.json:/app/device_auths.json
      stdin_open: true # docker run -i
      tty: true        # docker run -t

Run it with: docker-compose run epic_free


Developer Guide 🚀

This guide is for Mac/Linux, but it is nearly the same for Windows. Alter it a bit if you're using Windows 😄.

Build & Test locally

Note: This will only build for 1 platform on your system. To build for other architectures (ARM-based), read chapter "Pushing images".

To build and test the image locally, use:

docker build --rm -t epicgames-freebies-claimer .

Test locally:

docker run --rm -it \
    --volume "$(pwd)/data:/app/data" \
    epicgames-freebies-claimer

# Debug via shell
docker run --rm -it epicgames-freebies-claimer sh

Authenticate to DockerHub/GithubPackage

Push images

MAKE SURE YOUR LOCAL IMAGE WORKS before using below commands. It it build and push to the registries.

Notes:

docker buildx build --rm \
    --platform linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7,linux/arm/v6 \
    --push \
    -t ghcr.io/jackblk/epicgames-freebies-claimer:latest \
    -t ghcr.io/jackblk/epicgames-freebies-claimer:1.5.6 \
    -t jackblk/epicgames-freebies-claimer:latest \
    -t jackblk/epicgames-freebies-claimer:1.5.6 \
    .

Currently I'm using EFC Builder to do the build and push.