Skip to content

This project is a simple example program for learning how to work with and build Docker images, based on a basic implementation of the classic game Asteroids.

Notifications You must be signed in to change notification settings

plofski/DockerAsteroids

Repository files navigation

Asteroids Game with Docker

This project is designed to help students on how to build and run Docker containers using a simple version of the classic Asteroids game.

Introduction

This repository contains a basic version of the Asteroids game implemented in HTML/JS with an FastAPI server as backend. The primary goal of this project is to provide a hands-on learning experience for building and running Docker containers.

The Docker image is available on Docker Hub at the following link: https://hub.docker.com/r/plofski/asteroids-game

Prerequisites

Before you begin, ensure you have the following installed on your machine:

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/asteroids-docker.git
    cd asteroids-docker
  2. Build the Docker image for your system:

    docker build -t asteroids-game .

Usage

  1. Run the Docker container:

    docker run -it -p 8000:8000 asteroids-game
  2. Open your web browser and navigate to http://localhost:8000 to play the Asteroids game.

building for an other target system

Want to build for other an other target platforms than yours?

  1. Build the docker image for the target platforms (using cross compilation)
    docker buildx build --platform {{target_platform}} -t asteroids-game .

building for multiple target systems and push to docker hub

Want to build for multiple target platforms and directly push to docker hub ?

  1. create an builder (only need to do it once)
        docker buildx create --use
  2. build for multiple target platforms and push to docker hub (Don't forget to login to docker hub first!) platforms are seperated by a comma, for example: linux/amd64,linux/arm64
        docker buildx build --platform {{platforms}} -t plofski/asteroids-game:latest --push .

About

This project is a simple example program for learning how to work with and build Docker images, based on a basic implementation of the classic game Asteroids.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published