

Win at 2048 with Docker and ShutIt (Redux)
source link: https://zwischenzugs.com/2015/02/01/win-at-2048-with-docker-and-shutit-redux/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Win at 2048 with Docker and ShutIt (Redux)
zwischenzugs Uncategorized February 1, 2015September 21, 2015
1 Minute
This post is based on material from Docker in Practice, available on Manning’s Early Access Program. Get 39% off with the code: 39miell
Steps to win at 2048
I blogged about this before, but have revisited it and made the process much easier and more robust.
1) To play 2048:
docker run -d -p 5901:5901 -p 6080:6080 --name win2048 imiell/win2048
2) Start up the vnc session:
vncviewer localhost:1
password for vnc is:
vncpass
Play for a bit.
3) When ready to “save game”:
docker tag -f my2048tag $(docker commit win2048)
Then, if you lose
4) go back to your save point with:
docker rm -f win2048 docker run -d -p 5901:5901 -p 6080:6080 --name win2048 my2048tag
and repeat steps 2) to 4) until you complete 2048!
Notes:
Command Annotations
docker run -d -p 5901:5901 -p 6080:6080 --name win2048 imiell/win2048
-d – run the container in daemon mode
-p … – publish ports related to vnc to the host
–name – give the container a name we can easily reference later
vncviewer localhost:1
Access the vncviewer on the ports 5901 and 6080.
docker tag -f my2048tag $(docker commit win2048)
The subshell (in italics) commits the files in the container to a docker image. The command returns a reference to the image that is in turn passed to the docker tag command. This forces the tag for the image to be set to my2048tag (or whatever you choose to call it.
docker rm -f win2048 docker run -d -P --name win2048 my2048tag
We must remove the container running so that the names don’t clash when we start it up again with docker run.
Build it Yourself
If you want to build the image yourself:
docker build https://raw.githubusercontent.com/ianmiell/shutit/master/library/win2048/Dockerfile
will make a local image you can tag. Code is here
Published by zwischenzugs
Recommend
-
14
Taming Slaves with Docker and ShutIt At our company we had a problem. We used Jenkins for CI, but had no clear way of setting up machines in a reliable portable and reproducible way. We had centralised VMs but provisi...
-
13
Using ShutIt and Docker to play with AWS (Part Two) zwischenzugs Uncategorized...
-
11
Talk on Docker and ShutIt Published by zwischenzugs View all posts by zwischenzugs
-
15
Using ShutIt and Docker to play with AWS (Part One) zwischenzugs Uncategorized...
-
9
Phoenix Deployment with Docker and ShutIt zwischenzugs Uncategorized...
-
21
Docker, ShutIt and the Perfect 2048 Game (Videos) Video of how to create a 2048 See also: to create the shutit server in 3 minutes and a mysql docker container creator:
-
13
Docker, ShutIt and the Perfect 2048 Game (4 – Halfway There) Published by zwischenzugs View all posts by zwis...
-
15
Docker, ShutIt and the Perfect 2048 Game (3 – Brute Force Escapes) Now that I’m getting near the end of the highest tile on 2048, the air is getting thin. I often get into a state like this:
-
20
Docker, ShutIt and the Perfect 2048 Game (2)
-
14
Docker, ShutIt, and The Perfect 2048 Game I cured my 2048 addiction by (almost) completing it. Obviously I didn’t get this far without cheating, but I did play every move.
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK