Phrase to describe a moving goal that is forever just out of reach

Solution 1:

Consider,

chase rainbows

: to waste your time trying to get or achieve something impossible (usually in continuous tenses) Cambridge Idioms Dictionary

[go on a] wild-goose chase

  1. a wild or absurd search for something nonexistent or unobtainable

  2. any senseless pursuit of an object or end; a hopeless enterprise Random House

[go on a] snipe hunt Google Pictures

: a futile search or endeavor. American Heritage® Dictionary

Solution 2:

You could call that a "carrot on a stick". It refers to a carrot dangled in front of a beast of burden by a stick held by the rider.

The similar "carrot or the stick" phrase refers to giving someone either a reward or a punishment.

Here is a write-up describing the two phrases. http://public.wsu.edu/~brians/errors/carrot.html

Solution 3:

Such a task would be tantalizing.

This is derived from the Greek myth of Tantalus, one of the sons of Zeus.

After stealing ambrosia from Mount Olympus, Tantalus was punished by the gods to stand in the underworld for eternity by fruit trees such that he could never quite reach the fruit.

As described in the Encyclopedia Britannica these goals would move when Tantalus attempted to get them:

According to Homer’s Odyssey, Book XI, in Hades Tantalus stood up to his neck in water, which flowed from him when he tried to drink it; over his head hung fruits that the wind wafted away whenever he tried to grasp them (hence the word tantalize). 

Solution 4:

Going right along with the theme established by Chenmunka, there is also the sisyphean task.

This is derived from the Greek myth of Sisyphus, an ancient king of Ephyra/ Corinth.

After being boastful and deceitful, Sisyphus was punished by the gods to roll a rock up a hill in the underworld, only to watch it immediately roll back down, and having to endlessly repeat this effort.