Skip to main content

Docker Script

docker build

# Build images
docker build -t your-username/image-name:tag <loacation>

docker push docker hub

docker push your-username/image-name:tag

To build a Docker image for the amd64 architecture from a macOS system (likely arm64 architecture on Apple Silicon), you can use Docker's buildx tool, which supports multi-platform builds.

Build the Image for amd64: Use the --platform flag to specify the target architecture:

docker buildx build --platform linux/amd64 -t my-image:latest .

Push to a Registry (Optional): To push the image directly to a container registry (e.g., Docker Hub), add --push:

docker buildx build --platform linux/amd64 -t my-dockerhub-user/my-image:latest --push .

-----------------------------------------------------------------------------------------------------------------------------

Start container

docker compose up 

Pull image 

docker compose pull

Down container

docker compose down

list container

docker ps

see env in container

docker exec -it <container_name> sh
cat /app/.env