Skip to content

justusbluemer/container-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GTM Bootstrap Debug Container

A minimal Docker container to debug connectivity issues with Google Tag Manager's server bootstrap file on Scaleway Serverless Containers.

The Problem

Containers are failing to fetch https://www.googletagmanager.com/static/serverjs/server_bootstrap.js during startup, causing errors like:

Error: connect ETIMEDOUT 142.251.220.168:443
Error: connect EHOSTUNREACH 2a00:1450:4006:811::2008:443 (this is expected, because IPv6 is not supported)
Fetching server bootstrap JS from https://www.googletagmanager.com/static/serverjs/server_bootstrap.js failed.

What This Container Does

  • Uses Node.js v22.16.0 (same as production)
  • Attempts to fetch the GTM bootstrap file with detailed logging
  • Performs connectivity checks (DNS resolution, etc.)
  • Retries failed requests with timing information
  • Starts an HTTP server on port 8080 for health checks
  • Provides detailed error information to help debug the issue

Build & Run

Local Testing

# Build the container (force AMD64 architecture for compatibility)
docker build --platform=linux/amd64 -t gtm-debug .

# Run locally for testing
docker run -p 8080:8080 gtm-debug

Deploy to Scaleway Serverless Containers

1. Install Scaleway CLI (if not already installed)

# macOS
brew install scw

# Linux/Windows - download from: https://github.com/scaleway/scaleway-cli/releases

2. Configure Scaleway CLI

# Initialize with your credentials
scw init

# Or if already configured, make sure you're using the right project
scw config set default-project-id 6a52b596-0f8f-4213-9684-346578593db1

3. Build and Tag for Scaleway Registry

# Build the container with Scaleway registry tag (AMD64 architecture required)
docker build --platform=linux/amd64 -t rg.fr-par.scw.cloud/gtm-debug-default/gtm-debug:latest .

4. Push to Registry

# Push the image
docker push rg.fr-par.scw.cloud/gtm-debug-default/gtm-debug:latest

5. Create Serverless Container

  1. Go to https://console.scaleway.com/
  2. Navigate to Serverless Containers
  3. Click "Create Container"
  4. Select your pushed image: rg.fr-par.scw.cloud/gtm-debug-default/gtm-debug:latest
  5. Set port to 8080
  6. Deploy

Expected Output

The container will show detailed logs including:

  • Node.js version confirmation
  • DNS resolution attempts
  • Connectivity test results
  • GTM bootstrap file fetch attempts with timing
  • Server startup confirmation

About

A test image for very early HTTP requests in Scaleway Serverless containers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published