sixeyed / diamol

Code samples for the book "Learn Docker in a Month of Lunches"
https://www.manning.com/books/learn-docker-in-a-month-of-lunches
Creative Commons Attribution Share Alike 4.0 International
496 stars 261 forks source link

CH 04 - Container image of the day does not go through #31

Open eliassal opened 3 years ago

eliassal commented 3 years ago

Exercise Packaging applications from source code into Docker Images 4.2 TRY IT NOW Run a container from the image, publishing port 80 to the host computer, and connecting to the nat network: docker container run --name iotd -d -p 800:80 --network nat image-ofthe-day

Problem Image gets created, but when running the above command for running the container, do Docker Logs, I see the following error image-of-the-day

Docker version Client: Docker Engine - Community Cloud integration: 1.0.9 Version: 20.10.5 API version: 1.41 Go version: go1.13.15 Git commit: 55c4c88 Built: Tue Mar 2 20:14:53 2021 OS/Arch: windows/amd64 Context: default Experimental: true

Server: Docker Engine - Community Engine: Version: 20.10.5 API version: 1.41 (minimum version 1.24) Go version: go1.13.15 Git commit: 363e9a8 Built: Tue Mar 2 20:26:56 2021 OS/Arch: windows/amd64 Experimental: false

Code version Please run git log -n 1 and paste the output. image-of-the-day-Code

Additional context Running in windows container context, tried linux container context, I get the same error

sixeyed commented 3 years ago

Hi @eliassal , this is odd - I've just tried the exercise myself and I don't get that issue, everything works fine. It looks like there's a duplicate annotation somewhere, maybe there's been a change to your source code?

Can you try cloning a fresh copy of the repo and trying again? You could also try adding --pull to the docker build command to make sure you have the latest base images.

eliassal commented 3 years ago

Thanks Elton, yes, you are correct, I cloned the repo again to a new location, as I had cloned the repo last year and reached Ch05 so maybe there was something messing up, the container works fine now. I wanted to refresh my memory before proceeding to next chapters as I was very occupied with other stuff for the last 6 months. Thanks again for your work and making this available for the community